Belirli bir sayfa için bir oturum süresini ayarlamak için nasıl

0 Cevap php

When you go to this page; http://www.ctuchicago.com/registration/login.php

Eğer ben yapılan form göreceksiniz. Ben bir 20 dakika bunun için zaman aşımına ayarlamak istiyorum daha kullanıcı adı ve şifre doğruysa ben bir oturum oluşturmak istiyorum. Ben bunu nasıl yapabilirim?

Benim check.php

$user = $_POST['user'];
$pass = $_POST['pass'];

$ruser = "a";
$rpass = "b";

if ($user == $ruser) {
 $logn = "True"; 
} else {
 $logn = "False";  
}

if ($pass == $rpass) {
 $logs = "True"; 
} else {
 $logs = "False";  
}


 if ($logn == "False" && $logs == "False") {
 echo '<script type="text/javascript">alert("The Username and The Password are both wrong ! Please check your information and try again.");history.go(-1);</script>';
 } elseif ($logn == "True" && $logs == "False") {
 echo '<script type="text/javascript">alert("The Username is True but something is wrong with the password you entered. Please check your information and try again.");history.go(-1);</script>';
 } elseif ($logn == "False" && $logs == "True") {
 echo '<script type="text/javascript">alert("The Password is True but something is wrong with the password you entered. Please check your information and try again.");history.go(-1);</script>';
 } else {
 $_SESSION['valid'] = "1";
 echo '<script type="text/javascript">window.location = "http://www.ctuchicago.com/registration"</script>';
 }

benim index.php (ben gerekli giriş istiyorum bu sayfayı.

    if ($_SESSION['valid']) {
 echo '<script type="text/javascript">window.location = "http://www.ctuchicago.com/registration/login.php"</script>';
} else { Code }

Thank You

0 Cevap