Error :(
Posted: Sat Apr 27, 2002 10:30 am
I'm learning how to set cookies right now, and I'm trying to set a cookie when the user logs in to my site. This is the code I'm using on the log in page:
When I run it I get this error:
Warning: Cannot add header information - headers already sent by (output started at /home/maxxxtor/public_html/prodigy/php/login/login2.php:3) in /home/maxxxtor/public_html/prodigy/php/login/login2.php on line 5
I've tried figuring out what this meant, but have no idea. Help would be appreciated, and if there is a site somewhere that explains certain errors to you, please show me that, too
Code: Select all
<?
setcookie("username",$name,time()+1209600);
include("/home/maxxxtor/public_html/prodigy/php/login/connect.php");
$sql = "SELECT id FROM pro_members WHERE name='$rname' and pass='$rpass'";
$result = mysql_query($sql) or die ("Unable to get results.");
$num = mysql_numrows($result) or die ("Your Username and/or Password are incorrect. If you feel you have recieved this message in error, please contact the <a href="mailto:website@hot.rr.com">webmaster</a>");
if ($num == 1) {
echo "Welcome to Prodigy! You are logged in as $rname !";
}
?>Warning: Cannot add header information - headers already sent by (output started at /home/maxxxtor/public_html/prodigy/php/login/login2.php:3) in /home/maxxxtor/public_html/prodigy/php/login/login2.php on line 5
I've tried figuring out what this meant, but have no idea. Help would be appreciated, and if there is a site somewhere that explains certain errors to you, please show me that, too