Formulaire d'authentification
dadi.14
Messages postés
18
Statut
Membre
-
dadi.14 Messages postés 18 Statut Membre -
dadi.14 Messages postés 18 Statut Membre -
je suis entrain de faire un formulaire d'authentification mais toujours il m'affiche l'erreur suivant:
Parse error: syntax error, unexpected '$login' (T_VARIABLE) in C:\Program Files (x86)\EasyPHP-DevServer-13.1VC9\data\localweb\BBB\auth2.php on line 18
*******************************************************
voici mes deux pages: auth2.php
<?php
if(isset( $_POST['submit']))
{
$pseudo = htmlspecialchars(trim($_POST['pseudo'])) ;
$password =htmlspecialchars(trim($_POST['password'])) ;
if(empty($pseudo))
{
echo "veuillez saisir votre nom pseudo <br/>" ;
}else if(empty($password))
{
echo "veuillez saisir votre mot de passe" ;
}else
{
mysql_connect( "localhost", "root", "" ) ;
mysql_select_db( "issat" ) ;
$password = md5($password)
$login = mysql_query("SELECT * FROM utilisateur WHERE login='$pseudo' AND password='$password'");
$rows = mysql_num_rows($login);
if($rows==1)
{
echo "bienvenue ".$pseudo;
else
echo "nom d'utilisateur ou mot de passe incorrect" ;
}
}
}
?>
********************auth1.php***************************
<html>
<head>
<title></title>
</head>
<body>
<form method="POST" action="auth2.php" >
<table border="0" align="center" cellspacing="2" cellpadding="2">
<tr align="center">
<td>nom d'utilisateur</td>
<td><input type="text" name="pseudo"></td>
</tr>
<tr align="center">
<td>mot de passe</td>
<td><input type="password" name="password"></td>
</tr>
<td colspan="2"><input type="submit" name="submit" value="se connecter"></td>
</tr>
</table>
</form>
</body>
</html>
Parse error: syntax error, unexpected '$login' (T_VARIABLE) in C:\Program Files (x86)\EasyPHP-DevServer-13.1VC9\data\localweb\BBB\auth2.php on line 18
*******************************************************
voici mes deux pages: auth2.php
<?php
if(isset( $_POST['submit']))
{
$pseudo = htmlspecialchars(trim($_POST['pseudo'])) ;
$password =htmlspecialchars(trim($_POST['password'])) ;
if(empty($pseudo))
{
echo "veuillez saisir votre nom pseudo <br/>" ;
}else if(empty($password))
{
echo "veuillez saisir votre mot de passe" ;
}else
{
mysql_connect( "localhost", "root", "" ) ;
mysql_select_db( "issat" ) ;
$password = md5($password)
$login = mysql_query("SELECT * FROM utilisateur WHERE login='$pseudo' AND password='$password'");
$rows = mysql_num_rows($login);
if($rows==1)
{
echo "bienvenue ".$pseudo;
else
echo "nom d'utilisateur ou mot de passe incorrect" ;
}
}
}
?>
********************auth1.php***************************
<html>
<head>
<title></title>
</head>
<body>
<form method="POST" action="auth2.php" >
<table border="0" align="center" cellspacing="2" cellpadding="2">
<tr align="center">
<td>nom d'utilisateur</td>
<td><input type="text" name="pseudo"></td>
</tr>
<tr align="center">
<td>mot de passe</td>
<td><input type="password" name="password"></td>
</tr>
<td colspan="2"><input type="submit" name="submit" value="se connecter"></td>
</tr>
</table>
</form>
</body>
</html>