בעיה | לא מצליח ליצור עוגייה
בטופס הרשמה זה מצליח ליצור לי עוגייה אבל בעמוד התחברות זה שאני מנסה להיתחבר זה נותן לי שגיעה
קוד php:
PHP קוד:
<?
if (!isset($_POST['login_submit']))
{}
else
{
$username = htmlspecialchars( $_POST['username'] ) ;
$password = htmlspecialchars( $_POST['password'] ) ;
if (!empty($_POST['username']) && !empty($_POST['password']))
{
$link = mysql_connect('localhost' , 'root' , '') or die('Mysql Error: ' . mysql_error());
mysql_select_db('funni' , $link) or die('Mysql Error: ' . mysql_error());
$query = "SELECT * FROM user WHERE username='$username' && password='$password'" ;
$Result = mysql_query($query) or die('Mysql Error: ' . mysql_error());
$N = mysql_num_rows($Result);
if($N === false)
die('Mysql Error: ' . mysql_error());
if ($N < 1)
{
$erorlogin='שם משתמש או סיסמה לא נכונים';
}
else
{
setcookie("funniuser","$username",time()+31536000);
setcookie("funnipassword","$password",time()+31536000);
}
}
else
{
$erorlogin='שם משתמש או סיסמה לא נכונים';
}}
?>
השגיעה:
PHP קוד:
Warning: Cannot modify header information - headers already sent by (output started at c:wampwwwfunniindex.php:2) in c:wampwwwfunniindex.php on line 25
Warning: Cannot modify header information - headers already sent by (output started at c:wampwwwfunniindex.php:2) in c:wampwwwfunniindex.php on line 26
|