Probleme avec HEADER en php
Résolu
smoutsmout
Messages postés
160
Statut
Membre
-
Utilisateur anonyme -
Utilisateur anonyme -
Salut salut,
J'ai un soucis avec header en php, j'ai posté ma question dans le forum programmation, mais on n'a pas pu m'aider à résoudre mon probleme.
si vous pouvez m'aider c'est ici :
http://www.commentcamarche.net/forum/affich 6989779 erreur php
merci d'avance.
J'ai un soucis avec header en php, j'ai posté ma question dans le forum programmation, mais on n'a pas pu m'aider à résoudre mon probleme.
si vous pouvez m'aider c'est ici :
http://www.commentcamarche.net/forum/affich 6989779 erreur php
merci d'avance.
Configuration: Windows Vista Internet Explorer 7.0
7 réponses
-
-
Aforce de modifier je sais plus trop ce que j'ai changer ou pas mais je te donne le code :
Page "ValidationIdentification.php" :
<?php
session_start();?>
<?
function testSaisie($login, $motpasse)
{
if (empty($login) or empty($motpasse))
return "pasOK";
}
$login= $_REQUEST["login"];
$motpasse = $_REQUEST["motpasse"];
if (testSaisie($login, $motpasse)=="pasOK")
{
Header("location:ErreurIdentification2.html");
exit();
}
include("connexion.php");
$sql = "SELECT login, mdp FROM admin WHERE login='$login'";
$result = mysql_query($sql);
$ligne = mysql_fetch_array($result);
if ($ligne['mdp'] != $motpasse)
{
Header("location:ErreurIdentification.html");
exit();
}
else
{
$_SESSION['login']=$login;
Header ("location:liste_news.php");
exit();
}
?>
ce sont les header qui foirent ca me donne l'erreur :
Warning: Cannot modify header information - headers already sent by (output started at c:\program files\easyphp1-8\www\nautiscaphe\validationidentification.php:4) in c:\program files\easyphp1-8\www\nautiscaphe\validationidentification.php on line 17 -
okk
essaye ==>
<?php
session_start();
/* j'ai juste enlevé ?> et <?*/
function testSaisie($login, $motpasse)
{
if (empty($login) or empty($motpasse))
return "pasOK";
}
$login= $_REQUEST["login"];
$motpasse = $_REQUEST["motpasse"];
if (testSaisie($login, $motpasse)=="pasOK")
{
#####################################################
header("Location:ErreurIdentification2.php");
exit();
}
include("connexion.php");
$sql = "SELECT login, mdp FROM admin WHERE login='$login'";
$result = mysql_query($sql);
$ligne = mysql_fetch_array($result);
if ($ligne['mdp'] != $motpasse)
{
header("Location:ErreurIdentification.php");
exit();
}
else
{
$_SESSION['login']=$login;
header ("Location: liste_news.php");
exit;
}
?> -
-
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question -
aïe raté, maintenant j'ai :
Notice: Undefined index: mdp in c:\program files\easyphp1-8\www\nautiscaphe\validation_identification.php on line 11
Warning: Cannot modify header information - headers already sent by (output started at c:\program files\easyphp1-8\www\nautiscaphe\validation_identification.php:11) in c:\program files\easyphp1-8\www\nautiscaphe\validation_identification.php on line 15 -
j'ai trouvé ma connerie :
c'était tout con :
il falait mettre
$motpasse = $_REQUEST["motpasse"];
au lieu de
$motpasse = $_REQUEST["mdp"];
ca marche
désolée pour le dérangement
et merci. -