You are here: Problem to set a cookie « PHP Programming Language « IT news, forums, messages
Problem to set a cookie

Posted by zek2005 on 02/04/07 18:09

Hi!

I validate a user and set a cookie woht the following sentence:

setcookie("usNick",$nickN,time()+7776000);
setcookie("usPass",$passN,time()+7776000);

then I want to validate if the cookie is set with the following
sentence and it seems to enter in the "else", so the cookie was not
established.

if(isset($HTTP_COOKIE_VARS["usNick"]) &&
isset($HTTP_COOKIE_VARS["usPass"]))
{
$result = mysql_query("SELECT * FROM usuarios WHERE nick='".
$HTTP_COOKIE_VARS["usNick"]."' AND password='".
$HTTP_COOKIE_VARS["usPass"]."'");
}
else
{
setcookie("usNick","x",time()-3600);
setcookie("usPass","x",time()-3600);
}

Can anyone help me with this? I mena, setting the cookie correctly

Regards,

Ezequiel

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация