Bonjour à tous
voici l'erreur que m'affiche mon script:
Warning:Warning:session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\xampp\htdocs\tuto\tchat\index.php:1) in C:\xampp\htdocs\tuto\tchat\index.php on line 3Mon script est le suivant:session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\tuto\tchat\index.php:1) in C:\xampp\htdocs\tuto\tchat\index.php on line 3
http://www.programmingfacts.com/solv...-already-sent/
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
23
24
25 <?php if(!empty($_POST) && isset($_POST["pseudo"]) && !empty($_POST["pseudo"])){ session_start(); $_SESSION["pseudo"] = $_POST["pseudo"]; header("location:tchat.php"); } ?> <!DOCTYPE> <html lang="fr"> <head> <meta charset="UTF-8" /> <title>Mon tchat en Ajax</title> <link rel="stylesheet" href="style.css"/></script> </head> <body> <div id="conteneur"> <h1>Mon tchat</h1> <form action="index.php" method="POST"> Pseudo : <input type="text" name="pseudo"/> <input type="submit" value="tchatter"/> </form> </div> </body> </html>
J'ai appliqué cette solution mais rien .
Merci pour votre aide
Partager