Salut a tous,
j'obtient cette erreur la :
Warning: Cannot modify header information - headers already sent by (output started at /Applications/MAMP/htdocs/forum/authentification.php:10) in /Applications/MAMP/htdocs/forum/authentification.php on line 38
Voici mon code :
Code :
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <title>Document sans nom</title>
- </head>
- <body>
- <h1>Authentification</h1>
- <?php
- if (isset($_POST['valider']))
- {
- $login= $_POST['login'];
- $password= $_POST['password'];
- $password = md5($password);
- $pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
- $bdd = new PDO('mysql:host=localhost; dbname=forum', 'root', 'root', $pdo_options);
- $req = $bdd->prepare
- (" SELECT password
- FROM users where username='$login'" );
- $req->execute();
- $mdp = $req->fetchAll(PDO::FETCH_ASSOC);
- $password_md5 = $mdp[0]['password'];
- if($password_md5 != $password)
- {
- echo "erreur de mot de saisie";
- }
- else
- {
- header("Location: index2.php" );
- }
- }
- ?>
- <form id="authentification" method="post">
- <label>Username: </label>
- <input id="login" name="login" type="text" />
- <label>Password: </label>
- <input id="password" name="password" type="text" />
- <input type="submit" name="valider"/>
- </form>
- </body>
- </html>
|
Quelqu'un peut m'aider?
merci
Message édité par adeel-fbf le 13-04-2011 à 01:22:18