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
|
<?php
require_once ("../connection.php");
require_once ("../fonctions.php");
// Connection à la BDD, voir le fichier 'connection.php' pour les détails.
connect_BDD();
$admin_index = mysql_real_escape_string($_POST['admin_index']);
$mdp_index = mysql_real_escape_string($_POST['mdp_index']);
$query = mysql_query("SELECT user, mdp FROM admin WHERE user='$admin_index' && mdp='$mdp_index'");
$donnees = mysql_fetch_array($query);
if (($donnees['user'] != $admin_index) && ($donnees['mdp'] != md5($mdp_index)))
{
header('Location: index.php');
exit();
}
// On ferme la BDD.
mysql_close;
?> |