[thelist] PHP help required please

Warden, Matt mwarden at mattwarden.com
Sun Feb 3 10:37:01 CST 2002


On Feb 3, Dave Stevens had something to say about [thelist] PHP help...

>Sorry, me again.
>
>I'm now trying to set a cookie that stores the username once the user's name
>and password has been checked, so that I can use it in a different page.
>I have tried all of the following:
>
>setcookie("LOGININFO", "$username"); // inside some other php instructions
>
><?  setcookie("LOGININFO", "$username"); ?>
>
><?php setcookie("LOGININFO", "$username"); ?>
>
>and the PHP4 variant
>
> <? session_register("username"); ?>

Martin's post answered your question, but I just wanted to point out that
this last one is completely different than the others. It does NOT store
the value of "username" in a cookie. What it does is create a session
variable on the server named "username", with no value. The only cookie
that would be stored is the session id.

setcookie() is still the function you want even in PHP4.

Thanks,

--
mattwarden
mattwarden.com




More information about the thelist mailing list