Bonjour,
Pour une identification, j'utilise un formulaire qui renvoie ses données vers un code d'identification.
Or, il y a un problème avec les accents.
index.php :
form.php :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 <?php session_start(); // On démarre la session AVANT toute chose ?> <!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> <title>test3/index.php</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" type="text/css" href="styles/style.css" /> </head> <body> <?php include("includes/head.php");?> <?php include("includes/form.php")?> </body> </html>
identification.php :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 <?php echo '<div id="corpsdiv" class="tb"> <form method="post" action="includes/identification.php" class="tb"> <div id="divleft"> <p>Identifiant : </p> </div> <div id="divright"> <input type="text" name="pseudo" value="identifiant" /><br/><br/> <input type="password" name="pass" /><br/><br/> <input type="submit" value="Valider" /> </div> </form> </div>' ?>
Donc c'est pour le case "valérie" que ça coince ou je ne sais pas !
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 <?php session_start(); if (isset($_POST['pseudo']) AND (isset($_POST["pass"]))){ switch ($_POST['pseudo']){ case "identifiant": if ($_POST["pass"] = "mdp"){ $_SESSION['pseudo'] = $_POST['pseudo']; header ('location:../acceuil.php'); exit(); }; case "valérie": if ($_POST["pass"] = "pwd"){ $_SESSION['pseudo'] = $_POST['pseudo']; header ('location:../acceuil.php'); exit(); }; default: header ('location:../index.php'); exit(); } } ?>
Merci de bien vouloir m'aider !!!
Partager