HollySpirut
Guest
cookie не ставятся
Форма:
Код(login.php):
Кики не ставятся. Что я делаю неправильно?
Форма:
PHP:
<form action="login.php" method="post">
<input type="text" name="username" size="10" maxlength="50" value="" />
<input type="text" name="pass" size="10" maxlength="50" value="" />
<input type="submit" size="10" value="Go" />
</form>
PHP:
if(mysql_connect('localhost','#user#','#pass#'))
{
mysql_select_db('#db_name#');
$r=mysql_query("SELECT style FROM `users` WHERE `username`='".str_replace("'","\\'",$username)."' AND `hash`='".md5($pass)."'");
$st=@mysql_result($r,0,0);
if (!empty($st))
{
$text='You style is '.$st.'<br>';
}
}
SetCookie('username',$username,mktime(5));
SetCookie('pass',$pass,mktime(5));