[PHP-JS] problème headers already sent
bonjour tout le monde! :)
voila j'ai un problème dans mon script, il marche très bien en local, et là je viens de le balancer sur free et j'ai plein d'erreurs dont 3 erreurs "headers already sent" j'ai eu beau regarder s'il n'y avait pas d'espaces ni rien avant mes "session_start()" mais rien du tout, je ne vois vraiment pas ce qui plante...
alors si vous pouviez m'aider, je vous fourni une partie de mon code :
Code:
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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
/*----------------Fonction Identification($login, $password)------------*/
function identification($login, $password)
{
$loginOK = false;
$password = md5($password);
//on vérifie que les champs ne sont pas vide a developper en javascript plus tard
if (!empty($login))
{
if (!empty($password))
{
// on va chercher le mot de passe correspondant à ce login
$req = mysql_query(r_identification($login)) or die('erreur d\'identification');
// on vérifie que l'utilisateur existe bien
if (mysql_num_rows($req) > 0)
{
$data = mysql_fetch_assoc($req);
// on vérifie que son mot de passe est correct
if ($password == $data['mot_de_passe'])
{
$loginOK = true;
};
};
};
};
// Si le login est correct on ouvre la session
if ($loginOK==true)
{
$_SESSION['login'] = $data['identifiant'];
require("identification.php");
}
else
{
require ("corp_index.php");
echo 'une erreur est survenue, veuillez réessayer';
};
};
/*--------------------- Requete identification--------------------*/
function r_identification($login)
{
return "SELECT *
FROM UTILISATEURS
WHERE identifiant = '$login'";
};
/*------------page verif.php---------*/
<?php
session_start();
$login = $_POST["identifiant"];
$password = $_POST["mdp"];
require ("dm.php");
connexion();
identification($login,$password);
deconnexion();
?> |
et voila les erreurs que j'ai :
Citation:
Warning: session_start() [function.session-start]: open(/mnt/105/sdb/9/b/he.ogame/sessions/sess_faca9cfc4aa121002dd913c5cc2c5c24, O_RDWR) failed: No such file or directory (2) in /mnt/105/sdb/9/b/he.ogame/ftp/Stage/verif.php on line 3
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /mnt/105/sdb/9/b/he.ogame/ftp/Stage/verif.php:3) in /mnt/105/sdb/9/b/he.ogame/ftp/Stage/verif.php on line 3
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /mnt/105/sdb/9/b/he.ogame/ftp/Stage/verif.php:3) in /mnt/105/sdb/9/b/he.ogame/ftp/Stage/verif.php on line 3
Warning: Unknown(): open(/mnt/105/sdb/9/b/he.ogame/sessions/sess_faca9cfc4aa121002dd913c5cc2c5c24, O_RDWR) failed: No such file or directory (2) in Unknown on line 0
Warning: Unknown(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/mnt/105/sdb/9/b/he.ogame/sessions) in Unknown on line 0
je pense que c'est juste ce bout de code la qui bug, si vous trouvez quelque chose n'hésitez pas ;) merci d'avance!