[thelist] PHP help required please

Dave Stevens stem at stemofficial.co.uk
Sun Feb 3 09:50:01 CST 2002


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"); ?>

also within other instructions and on its own.
basically, the problem is that no matter which of these I use, I get the
same error message:

Warning: Cannot add header information - headers already sent by (output
started at /home/sites/site108/web/mrw/customers/login.php:3) in
/home/sites/site108/web/mrw/customers/login.php on line 3

where the line number is the line on which I place the above variations of
code.

once again, any help gratefully received
dave stevens





More information about the thelist mailing list