[thelist] PHP help required please

Dave Stevens stem at stemofficial.co.uk
Sun Feb 3 14:43:00 CST 2002


I can't seem to stay away ;)

the cookie is assigned the value of the username, as I want it to, and the
content of the cookie can be displayed on the same page as it is set on, but
on any other page in the site, the cookie has no value. any ideas what I
might be doing wrong?

seriously sorry for coming back AGAIN :S
cheers
Dave Stevens

> Have the form send the username to the page like this:
>
> <?php
>
> if (isset($username))
> {
> // set cookie and tell user
> } else {
> // print form
> // the form returns to this page
> // so that the cookie will be set
> }
>
> ?>
>
> And you don't need to put the setcookie() right at the START, just before
> you echo() anything or have any HTML.
>
> --jason





More information about the thelist mailing list