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
| <?php
session_start();
isset($sessSanoss);
isset($sessSacodeconf);
isset($sessIdsite);
isset($sessAffno);
isset($sessSamatric);
isset($sessNom);
isset($sessPrenom);
isset($sessType);
//$rowslog=$_GET['rowslog'];
include("include/connexion_base.php");
if (!isset($_POST['Login']) && !isset($_POST['Pwd'])){
$message = "Vous devez saisir un login et un code d'accès1";
header ("location: index.php?message=$message");
exit;
}
else{
$sqllog = "SELECT idsite, type, code ";
$sqllog .= " from rusers";
$sqllog .= " where login = '".$_POST['Login']."'";
$sqllog .= " and pwd = '".$_POST['Pwd']."'";
//$resultlog = mysql_query($sqllog);
//$rowslog = mysql_num_rows($resultlog);
$_SESSION['resultlog']= mysql_query($sqllog);
$_SESSION['rowslog'] = mysql_num_rows($_SESSION['resultlog']);
//echo ( " $rowslog Rows\n") ;
//$rowslog=$_GET['rowslog'];
header ("Location: users/fiche.php");
if ($_SESSION['rowslog'] < 1){
$message = "Vérifiez votre login et code d'accès4";
header ("location: index.php?message=$message");
//header ("Location: users/fiche.php");
exit;
}
elseif($_SESSION['rowslog'] == 1){
//$resultlog=$_GET['resultlog'];
//SI LOGIN CORRECT ENREGISTRE SESSION
//$_SESSION['sessIdsite'] = mysql_result($resultlog,0,idsite);
//$_SESSION['sessCode'] = mysql_result($resultlog,0,code);
//$_SESSION['sessType']= mysql_result($resultlog,0,type);
//session_register('sessIdsite');
//session_register('sessCode');
//session_register('sessType');
$_SESSION['sessIdsite']=mysql_result($_SESSION['resultlog'],0,idsite);
$_SESSION['sessCode']=mysql_result($_SESSION['resultlog'],0,code);
$_SESSION['sessType']=mysql_result($_SESSION['resultlog'],0,type);
//$IP=$REMOTE_ADDR;
//include("include/history.php");
header ("Location: users/fiche.php");
}
}
}
?> |
Partager