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 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
| <?php
session_start();
if (isset($_SESSION["idsession"])>0)
{
$idsession=$_SESSION["idsession"];
if ($idsession != "")
{
@header("Location: general.php");
}
}
else
{
include ("../page_annexe/connect.php");
@mysql_connect($serveur,$login,$pass) or die("Connection non effectuée ...");
@mysql_select_db("$base") or die("Mauvaise base");
if(isset($_POST['verif'])>0)
{
$verif=$_POST['verif'];
$login=$_POST['login'];
$login=stripslashes($login);
$login=mysql_real_escape_string($login);
$pass=$_POST['pass'];
$pass=stripslashes($pass);
$pass=mysql_real_escape_string($pass);
$erreur=$_GET['erreur'];
if($verif=="oui")
{
$req=mysql_query("SELECT * FROM admins where login_admin='".$login."' AND pass_admin='".$pass."'");
while($data=mysql_fetch_array($req))
{
$id_admin=$data['id_admin'];
}
if($id_admin=="" || ($login=="" && $pass==""))
{
@header("Location: login.php?erreur=oui");
}
else
{
$idsession=$id_admin;
$_SESSION['idsession']=$id_admin;
@header("Location: general.php");
}
}
else
{
echo "
<LINK REL=\"SHORTCUT ICON\" HREF=\"../favicon.ico\";>
<title>Page de login</title>
<link rel='stylesheet' type='text/css' href='../page_annexe/css.css'>
<table>
<tr>
<td>
<form method='POST' name='F'>";
echo "<fieldset><legend align='left'><font>Login de connexion à l'administration</font></legend>
<table border='0'><tr><td width='350'>
<table>";
if(isset($_GET['erreur'])>0){
$erreur=$_GET['erreur'];
if($erreur=="oui")
{
echo "<tr><td colspan='2'><b><i>Le nom ou le mot de passe est incorrect</i></b></td></tr> ";
}
}
else
{}
echo "
<tr><td>Login</td><td><input type='text' name='login'></td></tr>
<tr><td>Pass</td><td><input type='password' name='pass'></td></tr>
<tr><td colspan='2'></td></tr>
<td colspan='2' align='right'>
<table class='table2'>
<tr>
<td>
<input type='hidden' name='verif' value='oui'>
<input type='submit' class='inputb' value='Connexion'></form>
</td>
<td></td>
</tr></table>
";
echo "</td></tr></table></fieldset>";
}
}
else
{
echo "
<LINK REL=\"SHORTCUT ICON\" HREF=\"../favicon.ico\";>
<title>Page de login</title>
<link rel='stylesheet' type='text/css' href='../page_annexe/css.css'>
<table>
<tr>
<td>
<form method='POST' name='F'>";
echo "<fieldset><legend align='left'><font>Login de connexion à l'administration</font></legend>
<table border='0'><tr><td width='350'>
<table>";
if(isset($_GET['erreur'])>0){
$erreur=$_GET['erreur'];
if($erreur=="oui")
{
echo "<tr><td colspan='2'><b><i>Le nom ou le mot de passe est incorrect</i></b></td></tr> ";
}
}
else
{
}
echo "
<tr><td>Login</td><td><input type='text' name='login'></td></tr>
<tr><td>Pass</td><td><input type='password' name='pass'></td></tr>
<tr><td colspan='2'></td></tr>
<td colspan='2' align='right'>
<table class='table2'>
<tr>
<td>
<input type='hidden' name='verif' value='oui'>
<input type='submit' class='inputb' value='Connexion'></form>
</td>
<td></td>
</tr></table>
";
echo "</td></tr></table></fieldset>";
}
}
?> |