if (isset($_POST['auth'])){
$remember = $_POST['remember'];
$login = $_POST['user'];
$passwd = $_POST['passwd'];
$result = mysql_query("select passwd from authentification where login='$login' and passwd='$passwd'");
while($row = mysql_fetch_row($result)){
$passwd2 = $row[0];
}
if ($passwd2==$passwd){
session_start();
$result2 = mysql_query("select * from authentification where login='$login' and passwd='$passwd'");
while($row = mysql_fetch_row($result2)){
$_SESSION['passwd'] = $passwd;
$_SESSION['login'] = $login;
if ($remember=='1') {
setcookie("oadminlogin", $_SESSION['login'], time()+60*60*24*100, "/");
setcookie("oadminpass", $_SESSION['passwd'], time()+60*60*24*100, "/");
} else {
setcookie("oadminlogin","" , NULL, "/");
setcookie("oadminpass","" , NULL, "/");
}
?>
}
}
else {echo '
Désolé, le nom utilisateur ou le mot de passe est invalide';}
}
?>
Accés au CMS du site echo $website; ?>
O-Admin © echo date('Y'); ?> logiciel CMS/Back Office de gestion de site internet
|