probleme de redirection apres requete
Posté : 22 mai 2007, 11:29
bonjour,
Voici mon code :
ma page ou je rentre mes identifiants
La page qui verifie les id
Tout va bien pour les tests sauf que quand je rentre les bons id ça ne m'envoi pas sur accueil.php mais sur connexion.php
Merci de votre aide
Voici mon code :
ma page ou je rentre mes identifiants
Code : Tout sélectionner
<body>
<table width="1024" border="0">
<tr>
<td align="center">
<table width="800" height="100" border="0">
<tr>
<td><img src="images/baniere.jpg" /></td>
</tr>
</table><br />
<table width="800" border="0">
<tr>
<td>
<form action="connexion.php" method="post">
<table width="300" border="0">
<tr>
<td width="300" align="center">Login</td>
</tr>
<tr>
<td width="300" height="28" align="center"><input name="login" type="text" /></td>
</tr>
<tr>
<td width="300" align="center">Password</td>
</tr>
<tr>
<td width="300" align="center"><input name="pass" type="password" /></td>
</tr>
</table>
<br />
<table width="300" border="0">
<tr>
<td width="300" align="center"><input name="entrer" type="submit" value="Connexion" /></td>
</form>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>Code : Tout sélectionner
<?php
include('connexion.inc');
if (isset($_POST['login']) && isset($_POST['pass'])) { // test des l'existances des variables
$sqlQuery = "Select COUNT(*)
FROM users
WHERE login_user = '".mysql_real_escape_string($_POST['login'])."'
AND pass_user = '".mysql_real_escape_string($_POST['pass'])."'";
$result = mysql_query($sqlQuery);
$array = mysql_fetch_row($result);
if($array[0] == 1) {
header("Location: accueil.php");
} else {
header("Location: index.php");
}
}
?>Merci de votre aide