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 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
|
<?php
session_name("DT");
session_start();
if(isset($_SESSION['Connecter']) && $_SESSION['Connecter'] == "ok")
{
?>
<script type="text/javascript">location.href = 'index.php?cp=5';</script>
<?
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="css/style.css" type="text/css"/>
<link href="libs/style4bis.css" rel="stylesheet" type="text/css" media="screen" title="style"/>
<script type="text/javascript" src="libs/js.js"></script>
</head>
<body>
<div id="entete">
<div id="entete_gauche"></div>
</div>
<div id="milieu">
<div id="menu1">
</div>
<div style="margin:30px 0 0 200px;border:solid 2px #0b55aa; height:300px;width:590px">
<p style="text-align:center;font-size:24px;margin-top:10px;font-weight:bold;color:#0c5599;">
Authentification</p>
<div style="background-color:#f5f5f5;margin:15px 0 0 50px;height:200px;width:500px">
<form method="post" action = "authentification.php?cp=5&<?php echo session_name().'='.session_id()?>">
<div style="margin:25px 4px 0 120px !important; margin:50px 4px 0 41px;float:left;">
<label style="color:#0c5599;" for="login">Nom d'utilisateur:</label>
</div>
<div id="log" >
<input style="margin-top:25px !important;margin-top:46px;" type="text" name="login" id="login"/>
</div>
<div style="margin:10px 0 0 120px !important;margin:10px 0 0 85px;">
<label style="color:#0c5599;" for="passwd">Mot de passe:</label>
<input style="margin-left:19px" type="password" name="passwd" id="passwd"/>
</div>
<div style="margin:8px 0 0 200px">
<input type="submit" value="Connexion" name="connexion" style="height:24px;width:85px;font-size:14px"/>
</div>
</form>
<?php
if(isset($_POST['connexion']) && $_POST['connexion'] !=""){
if(isset($_POST['login']) && $_POST['login']!="")
{
if(isset($_POST['passwd']) && $_POST['passwd']!="")
{
$login=$_POST['login'];
$passwd=$_POST['passwd'];
mysql_connect("localhost","root","visite_dt");
mysql_select_db("bd_visite");
/*$requete="select * from inspecteur where login='".$login."' and password ='".$passwd."'";
echo "r= ".$requete;*/
$requete="select * from inspecteur where login='".addslashes($login)."' and password ='".addslashes($passwd)."'";
/*echo "r= ".$requete;
$resultat = NULL;*/
$resultat = mysql_query($requete);
if($resultat)
{
if($row = mysql_fetch_row($resultat))
{
$_SESSION['Connecter'] = "ok";
$_SESSION['MatriculInspect'] = $row[0];
$_SESSION['NumDelegation'] = $row[1];
$_SESSION['NumCircon'] = $row[2];
$_SESSION['NomInspect'] = $row[3];
$_SESSION['PrenomInspect'] = $row[4];
?>
<script type="text/javascript">location.href = 'index.php?cp=5';</script>
<?php
}
echo "<br/><p style='color:red; font-size:12px;margin:10px 0 0 30px'>** Le nom d'utilisateur ou le mot de passe est incorrect.</p>";
}
else
{
echo "<br/><p style='color:red; font-size:12px;margin:10px 0 0 30px'>** Le nom d'utilisateur ou le mot de passe est incorrect.</p>";
}
}
else{
echo "<br/><p style='color:red; font-size:12px;margin:10px 0 0 30px'>** Veuillez saisir le mot de passe</p>";
?>
<script type='text/javascript'>
x="<input style='margin:26px 0 0 2px !important;margin:47px 0 0 2px' type='text' value='<?php echo $_POST['login']; ?>' name='login' id='login' value='eeeeeee'/>";
di = document.getElementById("log");
di.innerHTML = x;
</script>
<?php
}
}
else {
echo "<br/><p style='color:red; font-size:12px;margin:10px 0 0 30px'>** Veuillez saisir le nom d'utilisateur</p>";
}
}
?>
</div>
</div>
</div>
<div style="clear:both">
</body>
</html> |
Partager