1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
| <?php
session_start();
$connexion=mysql_connect('localhost','root', '*****');
$database=mysql_select_db('form_competence',$connexion);
$lb_loginok=false;
if (isset($_POST) && (!empty ($_POST['login'])) && (!empty ($_POST['password'])))
{
$sql_compare_login = "SELECT * FROM administrateurs WHERE adm_login LIKE '".$_POST['login']."' AND adm_pwd LIKE '".$_POST['password']."';";
$exe_compare_login = mysql_query ($sql_compare_login);
$data = mysql_fetch_assoc($exe_compare_login);
if(($data['adm_login']==$_POST['login']) && ($data['adm_pwd']==$_POST['password']))
{
$_SESSION['adm_nom']=$data['adm_nom'];
$_SESSION['adm_prenom']=$data['adm_prenom'];
$_SESSION['adm_login']=$data['adm_login'];
header("Location:admin_main.php");
}
else
{
echo "Login ou PSWD incorrect
Vérifiez éventuellement la casse de vos identifiants";
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>
The Web Lab - Connexion || Administration
</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel='stylesheet' type='text/css' href='style.css'/>
</head>
<body>
<form action='php/admin_login.php' method='post'>
<div class="main">
<table>
<tr>
<td>Login:</br></td>
<td><input type="text" name="can_login"><br/></td>
</tr>
<tr>
<td>Mot de passe:</br></td
<td><input type="password" name="can_pwd"><br/></td>
</tr>
<tr>
<td colspan="2"><input type="submit" name="do_connect" value="Connexion" id="button"><br/></td>
</tr>
</form>
</table>
</div>
</body>
</html> |
Partager