setcookie无法设置cookie! [英] setcookie fails to set cookie!

查看:99
本文介绍了setcookie无法设置cookie!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

第四次尝试..现在登陆失败,我通过打印检查

$ _COOKIE [''nordicnet_registration'']并且那里没有价值!伙计们,我在地球上做什么?b $ b我这样做????


以下是设置cookie的代码:


if($ hasLoggedIn&&($ row = mysql_fetch_row($ query))){

setcookie(''nordicnet_registration'',$ row [''nnet_user_registrationnumber''] ,

0,''/'');

@mysql_free_result($ query);

mysql_close($ dbConn)或die(' '无法关闭数据库'');

$ html。= $ font。 ''< font color = 000099> Takk for logging inn。对于forsatte

''。

"< a

href = http://$serverName/index.php?content = membersites /Palogget%20S1.php 。

''target = _top> klikk her< / a>< / font>< / font>'';

}否则if(sizeof($ _ POST) )> 0){

$ errorMsg。= $ font。 ''< font color = cc0000>< li> Det finns en problem med

db< / li>< / font>< / font>< p>'';

$ hasLoggedIn = 0;

}

因为PHP脚本在一个框架中,而不是使用header()我打印出来

一些带有链接的文本< a href = mylink.php target = _top>供用户点击

并转到另一页。到那时,cookie应该被注册,但是它不会在那里



我完全失去了。


Phil

Fourth attempt.. it fails now in login, I check by printing
$_COOKIE[''nordicnet_registration''] and there is no value there! Guys, what
on earth do I do about this????

Here is the code that sets the cookie:

if ($hasLoggedIn && ($row = mysql_fetch_row($query))) {
setcookie(''nordicnet_registration'', $row[''nnet_user_registrationnumber''],
0, ''/'');
@mysql_free_result($query);
mysql_close($dbConn) or die(''Could not close db'');
$html .= $font . ''<font color=000099>Takk for logging inn. For forsatte
'' .
"<a
href=http://$serverName/index.php?content=membersites/Palogget%20S1.php " .
'' target=_top>klikk her</a></font></font>'';
} else if (sizeof($_POST) > 0) {
$errorMsg .= $font . ''<font color=cc0000><li>Det finns en problem med
db</li></font></font><p>'';
$hasLoggedIn = 0;
}
Because the PHP script is in a frame, instead of using header() I print out
some text with a link <a href=mylink.php target=_top> for the user to click
and to go to another page. By then the cookie should be registered, yet
it''s not there!

I''m at a complete loss.

Phil

推荐答案

_COOKIE [''nordicnet_registration'']并且那里没有价值!伙计们,我在地球上做什么?b $ b我这样做????


以下是设置cookie的代码:


if(
_COOKIE[''nordicnet_registration''] and there is no value there! Guys, what
on earth do I do about this????

Here is the code that sets the cookie:

if (


hasLoggedIn&&(
hasLoggedIn && (


row = mysql_fetch_row(
row = mysql_fetch_row(


这篇关于setcookie无法设置cookie!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆