ferjani69
Messages postés1Date d'inscriptionlundi 31 mars 2008StatutMembreDernière intervention 1 avril 2008
-
1 avril 2008 à 10:51
mareme2009
Messages postés3Date d'inscriptionmercredi 2 avril 2008StatutMembreDernière intervention 2 juin 2008
-
2 juin 2008 à 18:41
mon probleme est lors de l authentification la verification de login et de mot passe ne passe pas et je ne sais pas c koi le pb exactement voila ma page de teste et svp aidez moi c tres urgent.merci.
<?php
/**
*
*
* @version $Id$
* @copyright 2008
*/
$idcreateur=session_start();
$idcrea=MYSQL_CONNECT("localhost","root","");
$sel1=MYSQL_SELECT_db("gestion_de_projets");
$REQ2="select login,pass from f_user,f_createur where login='$_POST[login]' AND password='$_POST[pass] AND (id_user IN f_createur.id_createur) ';";
$reslt=MYSQL_QUERY($REQ2) ;
$tab=mysql_fetch_array($reslt);
if($_POST['login']=$tab['login'] && $_POST['pass']=$tab['password'])
{
$connect=true;
$_SESSION['login']=$tab['login'];
$_SESSION['pass']=$tab['password'];
}
if ($connect==true)
{
header("Location: resultatcrea.php");
$reslt1=MYSQL_QUERY("INSERT INTO suivie SET id=id_createur,date='".strftime("%d/%m/%y - %H:%M:%S")."'");
}
else
{
header("Location: erreurcreateur.php");
}
mysql_close($idcrea);
?>
coucou747
Messages postés12303Date d'inscriptionmardi 10 février 2004StatutMembreDernière intervention30 juillet 201244 1 avril 2008 à 13:39
salut
$REQ2="select login,pass from f_user,f_createur where
login='$_POST[login]' AND password='$_POST[pass] AND (id_user IN
f_createur.id_createur) ';";
$reslt=MYSQL_QUERY($REQ2) ;
$tab=mysql_fetch_array($reslt);
if($_POST['login']=$tab['login'] && $_POST['pass']=$tab['password'])
dans ce code, il se trouve que ton if ne sert a rien. tu as deja fait cette verification dans ta requete sql.
tu peux faire par exemple :
$REQ2="select 1 from f_user,f_createur where
login='$_POST[login]' AND password='$_POST[pass]' AND id_user = f_createur.id_createur";
if(mysql_num_rows($REQ2)==1){
...
}