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