Problème connexion membre

Fermé
snice - 26 nov. 2007 à 22:09
 snice - 27 nov. 2007 à 14:21
Bonjour,
j'ai un problème avec mon code php pour l'accés à un compte membre.
L'identification se fait en deux fichiers :
identification.php

[code]
<html>
<head>
<title>Identification</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="identification.css" />
</head>
<body link="#666666" vlink="#666666" alink="#666666">
<?
if (isset($_GET["m"]))
{
?>
<form action="securite.php" method="post">
<div id="identification">
<p><u><font size=2 color=#cc0033><H1>- Identification -</H1></font></u></p>
<p><label>Login :</label><input class="css" type="text" name="userid" size="20" maxlength="20"/></p>
<p><label>Mot de passe :</label><input class="css" type="password" name="password" size="20" maxlength="20"/></p>
<p><input class="envoyer" type="submit" value="Envoyer" /></p>
<?
if ($_GET["m"]=="1")
{
echo "<p style=\"color:red;font-weight:bold;\">Mauvais login ou mot de passe !</p>";
}
?>
<p><a href="oublie.php">Mot de passe oublié ?</a></p>
<p><a href="validation.php">S'inscrire</a></p>

</div>
<?
}
?>
</body>
</html>
[/code]

et securite.php

[code]
<?php

$userid = htmlentities(trim($_POST['userid']));
$password = htmlentities(trim($_POST['password']));
$userid=mysql_escape_string($userid);
$password=mysql_escape_string($password);
if ($userid AND $password)
{
require "connect.inc.php";
$password = md5($password);
$res = mysql_query("SELECT Client_MDP FROM Client WHERE Client_Login='" . mysql_real_escape_string($userid) . "' AND Client_active='1'")
or die( 'Erreur MySQL : ' . mysql_error() );
$data = mysql_fetch_object($res);
if($res != $password)
{
Header("Location: identification.php?m=1");
}
else
{
session_start();
$_SESSION["verifie_Client"] = $userid;
Header("Location: ".$page_redirection);
}
}
else
{
Header("Location: identification.php?m=1");
}
?>
[/code]
A voir également:

1 réponse

pas de réponse ?
0