mon script ne fonctionne pas chez mon hébergeur alors kil ma
Posté : 12 avr. 2008, 13:05
J'ai un site en PHP développer en local ki fonctionne correctement mais lorsque je l'héberge sur mon serveur j'ai un probleme.
Au fait je fais une redirection à partir d'une page vers d'autres page après avoir vérifier des identifiants se ki marche correctement en local mais sur mon serveur web j'ai ce méssage:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/glseco87/public_html/admin/check.php:3) in /home/glseco87/public_html/admin/check.php on line 20
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/glseco87/public_html/admin/check.php:3) in /home/glseco87/public_html/admin/check.php on line 20
Warning: Cannot modify header information - headers already sent by (output started at /home/glseco87/public_html/admin/check.php:3) in /home/glseco87/public_html/admin/check.php on line 24
j'ai déplacer mon script de la page vers l'entete mais rien ne fais je vous le montre :
mais ne fonctionne pas chez mon hébergeur.
Au fait je fais une redirection à partir d'une page vers d'autres page après avoir vérifier des identifiants se ki marche correctement en local mais sur mon serveur web j'ai ce méssage:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/glseco87/public_html/admin/check.php:3) in /home/glseco87/public_html/admin/check.php on line 20
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/glseco87/public_html/admin/check.php:3) in /home/glseco87/public_html/admin/check.php on line 20
Warning: Cannot modify header information - headers already sent by (output started at /home/glseco87/public_html/admin/check.php:3) in /home/glseco87/public_html/admin/check.php on line 24
j'ai déplacer mon script de la page vers l'entete mais rien ne fais je vous le montre :
<?php
//recupération des variables
$login=$_POST['login'];
$pwd=$_POST['password'];
//connexion à la base de donnée
include "../admin/db.php";
$connexion = mysql_connect($adresse,$id,$pass)or die ('Error of connexion');
mysql_select_db($db)or die ('Selection de la base impossible');
//vérification des identifiants
$requete = "SELECT * FROM user WHERE Us_pseudo=\"$login\" and Us_pwd=\"$pwd\"";
$result=mysql_query($requete);
//verification de l'existence de resultat et recuperation si existence sinon redirection
if ($ligne = mysql_fetch_row($result)) {
$ide=$ligne[0];
$droit=$ligne[6];
//initialisation de la session
session_start();
$_SESSION['ide']=$ide;
if ($droit=="admin"){
//verification des droits
header("location:indexa.php?action=admin");
}else{
header("location:indexa.php?action=client");
}
}
else{
header ("location:index.php?action=error");
exit();
}
mysql_close();
?>
Je vous rappel ke ce script marche impécablement sur mon serveur d'évaluation sur ma machinemais ne fonctionne pas chez mon hébergeur.