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
| <html>
<head>
<body bgcolor="#99ccff">
<a href="file:///C|/wamp/www/Flan/index.html"></a>
</body>
<?php
session_start();
echo "<center>";
$x=mysql_connect('localhost','root','');
mysql_select_db('application',$x);
$v1=$_POST['Login'];
$v2=$_POST['Password'];
$trouv=0;
$req="select * from authentification";
$res=mysql_query($req);
while($lig=mysql_fetch_array($res))
{
if($lig['Login']==$v1 && $lig['Password']==$v2 )
{ if( $lig ['statut']=='admin')
$trouv=1;
else if($lig ['statut']=='user')
$trouv=2;
else
$trouv=0;
}
}
if($trouv==1)
{
echo "<script >alert(\"Vous etes admin!\" );
</script> ";
header("location:index.php");
}
else if ($trouv==2)
{ echo "<script >alert(\"Vous etes user!\" );
</script> ";
header("location:index.php");
}
else{
//echo "<html>";
//echo "<head>";
echo "<script>";
echo "alert('Check your login and / or password')";
echo "</script>";
//echo "</head>";
//echo "</html>";
//echo "<b><font color=\"red\"> LOGIN OU MOT DE PASSE INCORRECT </font></b> <BR/><BR/>";
//header("location:index.html");
}
?>
<META HTTP-EQUIV="Refresh" CONTENT="0; URL=file:///C|/wamp/www/projet/index.html">
</head>
</html> |
Partager