par
slktm » 01 août 2010, 23:08
Bonjour
mon code de redirection vers la page du membre ne fonctionne pas
je suis debutant et je ne trouve pas pourquoi
Code : Tout sélectionner
<?php
$tab = array(
'nom1' => array('mdp' => 'pass1', 'redir' => 'http://mon_site.com/reserve.html'),
'nom2' => array('mdp' => 'pass2', 'redir' => 'http://mon_site.com/redirect2.html'),
'nom3' => array('mdp' => 'pass3', 'redir' => 'redirect3.html')
);
$url = ($_POST['Identifiant']['redir']);
if(!empty($_POST['Identifiant']) AND !empty($_POST['mot_de_passe'])){
if(array_key_exists($_POST['Identifiant'], $tab)){
if($tab[$_POST['Identifiant']]['mdp'] == $_POST['mot_de_passe'])
{
echo "<SCRIPT LANGUAGE='JavaScript'>";
echo "window.setTimeout('window.location = $url ', 1)";
echo "</SCRIPT>";
}
else
{
header("Location: http://mon_site.com/espace_2/erreur.html");
}
}
else
$msg = 'Identifiant non reconnu.';
}
else
$msg = 'Les champs "Identifiant" et "Mot de passe" ne sont pas remplis.';
if($msg){
echo '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Codes d\'accès</title>
</head>
<body>
<div style="color: red; font-weight: bold;">'.$msg.'</div>
</body>
</html>';
}
?>
merci pour votre aide
bonne soirée à tous
Bonjour
mon code de redirection vers la page du membre ne fonctionne pas
je suis debutant et je ne trouve pas pourquoi
[code]<?php
$tab = array(
'nom1' => array('mdp' => 'pass1', 'redir' => 'http://mon_site.com/reserve.html'),
'nom2' => array('mdp' => 'pass2', 'redir' => 'http://mon_site.com/redirect2.html'),
'nom3' => array('mdp' => 'pass3', 'redir' => 'redirect3.html')
);
$url = ($_POST['Identifiant']['redir']);
if(!empty($_POST['Identifiant']) AND !empty($_POST['mot_de_passe'])){
if(array_key_exists($_POST['Identifiant'], $tab)){
if($tab[$_POST['Identifiant']]['mdp'] == $_POST['mot_de_passe'])
{
echo "<SCRIPT LANGUAGE='JavaScript'>";
echo "window.setTimeout('window.location = $url ', 1)";
echo "</SCRIPT>";
}
else
{
header("Location: http://mon_site.com/espace_2/erreur.html");
}
}
else
$msg = 'Identifiant non reconnu.';
}
else
$msg = 'Les champs "Identifiant" et "Mot de passe" ne sont pas remplis.';
if($msg){
echo '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Codes d\'accès</title>
</head>
<body>
<div style="color: red; font-weight: bold;">'.$msg.'</div>
</body>
</html>';
}
?>
[/code]
merci pour votre aide
bonne soirée à tous