Salut , débutant dans les sessions,j'ai un gros probleme
ça marche en local sur ma machine mais pas qd les fichiers sont chez l'hebergeur !
voici l'erreur :
et mon code associé :Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home.10.8/crdpitp/www/connexion.php:18) in /home.10.8/crdpitp/www/index.php on line 4
Warning: Cannot modify header information - headers already sent by (output started at /home.10.8/crdpitp/www/connexion.php:18) in /home.10.8/crdpitp/www/index.php on line 29
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 <?php session_start(); //ici commence l'erreur ! if (isset($_POST['login'])){ $login = addslashes($_POST['login']); $pass = addslashes($_POST['pass']); mysql_select_db($database_crdpitp, $crdpitp); $verif_query=sprintf("SELECT * FROM utilisateurs WHERE login='$login' AND pass='$pass'"); $verif = mysql_query($verif_query, $crdpitp) or die(mysql_error()); $row_verif = mysql_fetch_assoc($verif); $utilisateur = mysql_num_rows($verif); if ($utilisateur) { session_register("authentification"); $_SESSION['privilege'] = $row_verif['privilege']; $_SESSION['nom'] = $row_verif['nom']; $_SESSION['prenom'] = $row_verif['prenom']; $_SESSION['login'] = $row_verif['login']; $_SESSION['pass'] = $row_verif['pass']; header("Location:accueil.php"); } else { header("Location:index.php?erreur=login"); } } // Gestion de la déconnexion if(isset($_GET['erreur']) && $_GET['erreur'] == 'logout'){ $prenom = $_SESSION['prenom']; session_unset("authentification"); header("Location:index.php?erreur=delog&prenom=$prenom"); } ?>
merci de votre aide
Partager