שלום לכולם.
אני עושה התחברות ע"י cookies, אך בIE 7 משום מה לא עובד וב-FF כן עובד.
ניסתי למחוק את העוגיות והיסטוריה וכו'.
הנה הכתובת:
http://www.ventrilo.co.il/cms/cookie/login.php
שם משתמש וסיסמא: 1.
הקודים:
login.php
PHP קוד:
<?php
//////////////////////////////////////////////////////////////////
// Set user & pass for login and md5. ////////////////////////////
//////////////////////////////////////////////////////////////////
$user = "1";
$user = md5($user);
$pass = "1";
$pass = md5($pass);
//////////////////////////////////////////////////////////////////
// If i click login then... //////////////////////////////////////
//////////////////////////////////////////////////////////////////
if(isset($_POST['login']))
{
//////////////////////////////////////////////////////////////////
// If i get the right user and pass, login & set cookie. /////////
//////////////////////////////////////////////////////////////////
if ($user == md5($_POST['user']) && $pass == md5($_POST['pass']))
{
header("refresh: 0; url=manage.php");
setcookie("login_cookie","1",time()+3600);
}
//////////////////////////////////////////////////////////////////
// Else print us a message. //////////////////////////////////////
//////////////////////////////////////////////////////////////////
else
{
header("refresh: 2; url=login.php");
echo ("<center>Worng details!<center>");
}
}
//////////////////////////////////////////////////////////////////
?>
manage.php
PHP קוד:
<?php
//////////////////////////////////////////////////////////////////
// If the client have a cookie, show menu. ///////////////////////
//////////////////////////////////////////////////////////////////
if ($_COOKIE["login_cookie"])
{
echo '<center><h1>Welcome '.$_COOKIE['login_cookie'].'</h1></center>';
echo ("<br>");
echo ("<center>You are connected with cookies!</center>");
echo ("<br>");
echo ("<center><p><a href='logout.php'>Log out</a></p></center>");
}
//////////////////////////////////////////////////////////////////
// Else print us a worng message. ////////////////////////////////
//////////////////////////////////////////////////////////////////
else
{
header("refresh: 2; url=login.php");
setcookie("login_cookie","1",time()-3600);
echo ("<center>Pleas log in!</center>");
}
//////////////////////////////////////////////////////////////////
?>
logout.php
PHP קוד:
<?php
//////////////////////////////////////////////////////////////////
// Delete the cookie on client computer. /////////////////////////
//////////////////////////////////////////////////////////////////
header("refresh: 2; url=login.php");
setcookie("login_cookie","1",time()-3600);
echo ("<center>You are log out!</center>");
//////////////////////////////////////////////////////////////////
?>
למה ב-IE לא עובד? תודה לעוזרים.