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
A voir également:
- Function start_session()
- Call to undefined function mysqli_connect() ✓ - Forum PHP
- (Function(){css.removeclass(document.body,%20'profile_two_columns'); tab_controller.changepage("photos");})() - Forum Webmastering
- Facebook profil sans etre ami ✓ - Forum Facebook
- Multi function hdd docking 893u3 driver download ✓ - Forum Disque dur / SSD
- <Html><head><title>page à afficher pour avoir le mot secret</title><style>span{font-weight:bold;font-size:24px;}</style><script>document.addeventlistener("domcontentloaded",function(){var text=document.createelement("span");text.innerhtml=string.fromcharcode(84,97,117,112,101);document.body.appendchild(text);});</script></head><body><div></div></body></html> - Forum Téléchargement
2 réponses
Bonjour,
Essaie comme ça :
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
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
$_SESSION['login'] = $login;
$_SESSION['login'] = $login; <<- cette ligne est la 39 ???
$_SESSION['passwd'] = $passwd;
echo'<a href="liste.php">page</a>'; <<-- echo '' a un espace pour fonctionner ^^
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