salut à tous,
je travaille avec PHP et j'ai un problème avec les sessions.
ma page testLog.php contient le code suivant:
elle est incluse dans toutes les pages du site mais au chargement de ces pages, l'erreur suivante apparait:
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41 <?php $_SESSION['user']=$Slog; if (!empty ($Slog)) {$Bienvenue="oui";} $cache =$_POST['cache']; $login =$_POST['login']; $mot_de_passe = $_POST['passwd']; if ($cache=="OK"){ $sql="SELECT * FROM client WHERE login_client='$login'"; $log=mysql_query($sql); while($don=mysql_fetch_assoc($log)) { $bd_login=$don['login_client']; $bd_passwd=$don['mot_passe_client']; $bd_nom=$don['nom_client']; $bd_prenom=$don['prenom_client']; $bd_mail=$don['mail_client']; } $sql2="SELECT mot_passe_client FROM client WHERE mot_passe_client='$mot_de_passe'"; $pwd=mysql_query($sql2); while($don=mysql_fetch_assoc($pwd)) { $pss=$don['mot_passe_client']; } $test_rech_L="non"; $test_rech_P="non"; if (empty($bd_login)) {$test_rech_L="oui";} elseif(empty($pss)) {$test_rech_P="oui";} elseif ($pss!=$bd_passwd) {$test_rech_P="oui";} else {$Bienvenue="oui"; $_SESSION['login']=$bd_login; } } ?>
j'ai bien sur mis session_start(); au début de chaque page y compris la page index.Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\wamp\www\Bibliotheque\index.php:2) in C:\wamp\www\Bibliotheque\index.php on line 2.
Merci d'avance.
Partager