Function start_session()
wanish10
-
Reivax962 Messages postés 3742 Statut Membre -
Reivax962 Messages postés 3742 Statut Membre -
Bonjour,
je vais ouvrir une session avec le code php suivant:
if($login=''.$log.'' and $passwd=''.$pass.'')
{
session_start ();
$_SESSION['login'] = $login;
$_SESSION['passwd'] = $passwd;
echo'<a href="liste.php">page</a>';
}
else if($login!=''.$log.'' or $passwd!=''.$pass.'')
{
echo '<body onLoad="alert(\'Collaborateur Non Reconnu \')">';
echo '<meta http-equiv="refresh" content="0;URL=index.html">';
}
mais j'ai l'erreur suivant:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\AppServ\www\avlpro1\pass.php:6) in C:\AppServ\www\avlpro1\pass.php on line 39
SVP aidez moi
je vais ouvrir une session avec le code php suivant:
if($login=''.$log.'' and $passwd=''.$pass.'')
{
session_start ();
$_SESSION['login'] = $login;
$_SESSION['passwd'] = $passwd;
echo'<a href="liste.php">page</a>';
}
else if($login!=''.$log.'' or $passwd!=''.$pass.'')
{
echo '<body onLoad="alert(\'Collaborateur Non Reconnu \')">';
echo '<meta http-equiv="refresh" content="0;URL=index.html">';
}
mais j'ai l'erreur suivant:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\AppServ\www\avlpro1\pass.php:6) in C:\AppServ\www\avlpro1\pass.php on line 39
SVP aidez moi
2 réponses
-
session_start(); et non session_start ();
et que represente ta ligne 39 ?-
-
-
-
-
oui tout a fait, echo il fonctionne mais toujours j'ai cela:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\AppServ\www\avlpro1\pass.php:6) in C:\AppServ\www\avlpro1\pass.php on line 38
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\AppServ\www\avlpro1\pass.php:6) in C:\AppServ\www\avlpro1\pass.php on line 38
page cela est le lien
-
-
Bonjour,
Essaie comme ça :
if($login == $log && $passwd == $pass) { session_start(); $_SESSION['login'] = $login; $_SESSION['passwd'] = $passwd; echo'<a href="liste.php">page</a>'; } else { // Ça c'est moche comme façon de faire, mais c'est pas le problème alors je laisse echo '<body onLoad="alert(\'Collaborateur Non Reconnu \')">'; echo '<meta http-equiv="refresh" content="0;URL=index.html">'; }
Si ça ne marche pas, donne-nous le code source de ta page html générée histoire qu'on puisse lire la fameuse sortie déjà envoyée.
Xavier