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
|
<?php
require("../../../inc/connexion_bdd.php");
session_start();
if($_POST && !empty($_POST['id']) && !empty($_POST['mdp']))
{
$id = htmlentities($_POST['id'], ENT_QUOTES);
$mdp = htmlentities($_POST['mdp'], ENT_QUOTES);
$mdp_md5 = md5($mdp);
$req = mysql_query("SELECT id FROM intranet_sessions WHERE login='$id' AND mdp_md5='$mdp_md5'");
if(mysql_num_rows($req) > 0){
$_SESSION['_login'] = $id;
$_SESSION['_pass'] = $mdp_md5;
$_SESSION['time'] = time();
header('location:../../../extranet.php?p=news');
exit();
}
}
mysql_close();
header ("Location:../../../index.php?e=1");
?> |