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 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
|
<?php require_once('Connections/connection.php'); ?><?php
// *** login
session_start();
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($accesscheck)) {
$GLOBALS['PrevUrl'] = $accesscheck;
session_register('PrevUrl');
}
if (isset($_POST['login'])) {
$loginUsername=$_POST['login'];
$password=$_POST['password'];
$MM_fldUserAuthorization = "statut";
$MM_redirectLoginSuccess = "commande.php";
$MM_redirectLoginFailed = "login_erreur.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_connection, $connection);
//$LoginRS__query=sprintf("SELECT login, password, statut FROM membre WHERE login='%s' AND password='%s'",
$LoginRS__query=sprintf("SELECT login, password, statut, personne.id_personne FROM membre, possede_statut, personne WHERE login='%s' AND password='%s' and membre.id_personne=personne.id_personne and personne.id_personne=possede_statut.id_personne and possede_statut.statut='membre'",
get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password));
$LoginRS = mysql_query($LoginRS__query, $connection) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = mysql_result($LoginRS,0,'statut');
//declare two session variables and assign them
$GLOBALS['MM_Username'] = $loginUsername;
$GLOBALS['MM_UserGroup'] = $loginStrGroup;
//register the session variables
session_register("MM_Username");
session_register("MM_UserGroup");
//Code à ajouter pour PHP 4.2 et +
$_SESSION['MM_Username']=$loginUsername;
$_SESSION['MM_UserGroup']=$loginStrGroup;
if (isset($_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}
?>
<?
if(isset($_REQUEST["action_"])) {
switch($_REQUEST["action_"]) {
case "delog":
// Destruction de la session
unset($_SESSION["login"]);
session_destroy();
break;
}//fin du switch
} // isset
?>
<html>
<head>
<title>Boutique </title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="css/style.css" type="text/css" />
<style type="text/css">
<!--
.Style2 {font-family: "Times New Roman", Times, serif}
-->
</style>
</style><script type="text/javascript" language="Javascript" src="javascript/verificationlogin.js">
<!--
function verificationlogin()
{
}
//-->
</script>
</head>
<body>
<div id="Layertitre"> </div>
<img src="image/log.jpg" width="1470" height="170"/>
<div id="Menu">
<table width="160" border="1" align="center" cellpadding="0" cellspacing="1" bordercolor="#FFFFCC">
<tr>
<td width="160" height="50"><div align="center"><a href="index.html">ACCUEIL</a></td>
</tr>
<tr>
<td width="160" height="50"><div align="center"><a href="soins.html">SOINS/TARIFS</a></td>
</tr>
<tr>
<td width="160" height="50" ><div align="center"><a href="produits.php">PRODUITS</a></td>
</tr>
<tr>
<td width="160" height="50"><div align="center"><a href="contact.php">CONTACT</a></td>
</tr>
<tr>
<td width="160" height="50"><div align="center"><a href="plan.html">PLAN D'ACCES</a></td>
</tr> <p>
<p> </p>
<p> </p>
</table>
</div>
<div id="Layerhaut">
<a href="panier.php">Votre Panier</a> <a href="login.php">S'identifier</a> <a href="inscription.php">S'Inscrire</a> <a href="commande.php">Vos Commandes</a> <A href="login.php?action_=delog">Deconnexion</A></div>
<div id="Layercontenu">
<table width="100%" border="0" cellspacing="0">
<tr>
<td><p align="center" class="bodyText"> </p>
<p align="center" class="bodyText Style2"><strong><font size="6">LOGIN</font></strong></p>
<table width="100%" border="0">
<tr>
<td height="140"><div align="center">
<p>
<form name="form1" method="POST" action="<?php echo $loginFormAction; ?>" class="css" onsubmit="return formCheck(this);">
<table width="400" border="1" cellspacing="0" bordercolor="#FF0000">
<tr>
<td>
<div align="center">
<table width="400" border="0" cellspacing="0">
<tr>
<td colspan="2" class="bodyText"><div align="center"><font size="3" face="Verdana, Arial, Helvetica, sans-serif">Saisissez
les paramètres de votre compte </font></div></td>
</tr>
<tr>
<td width="202" class="bodyText"> <div align="right"><font size="3" face="Verdana, Arial, Helvetica, sans-serif">votre
Login: </font></div></td>
<td width="194" class="bodyText"> <input name="login" type="text" id="login"></td>
</tr>
<tr>
<td class="bodyText"><div align="right"><font size="3" face="Verdana, Arial, Helvetica, sans-serif">votre
mot de passe:</font></div></td>
<td class="bodyText"><label>
<input name="password" type="password" id="password" value=" ">
</label></td>
</tr>
<tr>
<td class="bodyText"><div align="right">
</div></td>
<td class="bodyText"> <input name="submit" type="submit" id="submit" value="VALIDER"></td>
</tr>
<tr>
<td colspan="2" class="bodyText"><div align="center"><font size="3" face="Verdana, Arial, Helvetica, sans-serif">Pour
créer un compte cliquez <a href="inscription.php">ICI </a></font></div></td>
</tr>
</table>
</div></td>
</tr>
</table>
</form>
<p></p>
</div></td>
</tr>
</table> </td>
</tr>
</table>
</div>
</body>
</html> |
Partager