Cookie not being created O_o

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Aaron
Forum Commoner
Posts: 82
Joined: Sun May 12, 2002 2:51 pm

Cookie not being created O_o

Post by Aaron »

Ok so the cookie isnt being created, dont know why O_o

Code: Select all

<? 

	$blah = mysql_query("SELECT username, password FROM unz_users WHERE username = '$username' and password = '$password'");
	$affected = mysql_fetch_assoc($blah);

			if($affected > 0)

	&#123;srand((double)microtime()*1000000); 
	$val_of_rand = rand(); 
	setcookie("$username",$val_of_rand,time()+14400,"/",".localhost/admin",0); 
	
	echo "<table width="100%" border="0" cellspacing="0" cellpadding="5">
	<tr><td align="left" valign="top" class="standard"><p><img src="images/icon_login.gif" width="32" height="32" align="left">Welcome to your account, $username. Your IP is $REMOTE_ADDR, and your password is $password</p></td></tr></table>";&#125;
	  
	  else
	  
	  &#123;echo "<table width="100%" border="0" cellspacing="0" cellpadding="5">
		<tr><td align="left" valign="top" class="standard"><p><img src="images/icon_login.gif" width="32" height="32" align="left">The details you entered did not match our records, please try again but hitting your back button.</p></td></tr></table>";&#125;

?>
Post Reply