setcookie
Posted: Sat Sep 21, 2002 4:40 pm
Having trouble with the setcookie function this is what I get:
Warning: Cannot add header information - headers already sent by (output started at /home/ba/public_html/user/emailshow.php:13) in /home/ba/public_html/user/emailshow.php on line 74
Warning: Cannot add header information - headers already sent by (output started at /home/ba/public_html/user/emailshow.php:13) in /home/ba/public_html/user/emailshow.php on line 75
Code:
Thanks in advance (note this code is from part of bigger script)
Warning: Cannot add header information - headers already sent by (output started at /home/ba/public_html/user/emailshow.php:13) in /home/ba/public_html/user/emailshow.php on line 74
Warning: Cannot add header information - headers already sent by (output started at /home/ba/public_html/user/emailshow.php:13) in /home/ba/public_html/user/emailshow.php on line 75
Code:
Code: Select all
<?php
setcookie("yourname", "Justin", time() + (86400 * 30));
setcookie("youremail", "hey@hey.net", time() + (86400 * 30));
// I even tried:
//@setcookie("yourname", "Justin", time() + (86400 * 30));
//still doesn't work!
echo "Thank you $yourname your message was sent!";
?>