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
|
<?php
include 'config.php';
$URL = basename($_SERVER['HTTP_REFERER']);
$requete = mysql_query("SELECT Groupes,Ip from $Table1 where Groupes='3'");
while($A = mysql_fetch_array($requete))
{
$ip = $_SERVER['REMOTE_ADDR'];
$ipp = $A['Ip'];
if($ip==$ipp)
{
echo '
<link href="style.css" rel="stylesheet" type="text/css">
<hr color="#FFFFFF">
<div align="center"><font size="4"><strong>Vous êtes bannie !</strong></font></div>
<hr color="#FFFFFF">
<br><br><div align="center"><a href=\'javascript:window.history.back()\'><font color="#0000FF"><strong>Retour</strong></font></a></div>
';
exit;
}
}
$Tableau = explode(" ", $_COOKIE[''.$Name.'']);
$Pseudo = $Tableau[0];
$Passe = $Tableau[1];
if ($Pseudo==NULL)
{
$Pseudo = strtolower($_POST['Pseudo']);
$Passe = strtolower($_POST['Passe']);
}
if($Pseudo==NULL)
{
echo '
<link href="style.css" rel="stylesheet" type="text/css">
<hr color="#FFFFFF">
<div align="center"><font size="4"><strong>Vous devez écrire votre pseudo.</strong></font></div>
<hr color="#FFFFFF">
<br><br><div align="center"><a href=\'javascript:window.history.back()\'><font color="#0000FF"><strong>Retour</strong></font></a></div>
';
exit;
}
if($Passe==NULL)
{
echo '
<link href="style.css" rel="stylesheet" type="text/css">
<hr color="#FFFFFF">
<div align="center"><font size="4"><strong>Vous devez écrire votre mot de passe.</strong></font></div>
<hr color="#FFFFFF">
<br><br><div align="center"><a href=\'javascript:window.history.back()\'><font color="#0000FF"><strong>Retour</strong></font></a></div>
';
exit;
}
$requete = mysql_query("SELECT Pseudo,Groupes from $Table1 where Groupes='3' AND Pseudo='$Pseudo'");
if (mysql_num_rows($requete) == 1)
{
echo '
<link href="style.css" rel="stylesheet" type="text/css">
<hr color="#FFFFFF">
<div align="center"><font size="4"><strong>Vous êtes bannie !</strong></font></div>
<hr color="#FFFFFF">
<br><br><div align="center"><a href=\'javascript:window.history.back()\'><font color="#0000FF"><strong>Retour</strong></font></a></div>
';
exit;
}
$requete = mysql_query("SELECT id,Domaine,Pseudo,Passe,Sexe,Age,Ville from $Table1 where `Pseudo`='$Pseudo' AND `Passe`='$Passe'");
if(mysql_num_rows($requete) == 0)
{
header("Location: erreur.php");
}
else
{
session_start();
$A = mysql_fetch_array($requete, MYSQL_ASSOC);
if($IdDomaine!==$A['Domaine'])
{
echo '
<link href="style.css" rel="stylesheet" type="text/css">
<hr color="#FFFFFF">
<div align="center"><font size="4"><strong>Vous ne pouvez pas vous connectez au domaine '.$UrlDuSite.', vous êtes inscrit sur un autre domaine !</strong></font></div>
<hr color="#FFFFFF">
<br><br><div align="center"><a href=\'javascript:window.history.back()\'><font color="#0000FF"><strong>Retour</strong></font></a></div>
';
exit;
}
$_SESSION['id'] = $A['id'];
$_SESSION['Pseudo'] = $A['Pseudo'];
$_SESSION['Passe'] = $A['Passe'];
setcookie($Name,$A['Pseudo']." ".$A['Passe']." ".$A['Sexe']." ".$A['Age']." ".$A['Ville'], time() + 31536000);
$date = date("d-m-Y à H:i:s");
$ip = $_SERVER['REMOTE_ADDR'];
$time = time();
mysql_query("UPDATE $Table1 SET `Statut` = 'En ligne', `DerniereConnexion` = '$date', `Online` = '1', `Quitter` = '$time', `Ip` = '$ip', `PointsVerif` = '$time' where Pseudo='".$A['Pseudo']."'");
if ($URL=="connexion.php") $URLFUTUR = 'membre.php'; else $URLFUTUR = $URL;
header("Location: $URLFUTUR");
mysql_close();
}
?> |
Partager