Probleme avec HEADER en php
Résolu/Fermé
smoutsmout
Messages postés
160
Date d'inscription
lundi 26 mai 2008
Statut
Membre
Dernière intervention
9 janvier 2009
-
24 juin 2008 à 09:53
Utilisateur anonyme - 24 juin 2008 à 10:38
Utilisateur anonyme - 24 juin 2008 à 10:38
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.
A voir également:
- Probleme avec HEADER en php
- Easy php - Télécharger - Divers Web & Internet
- Expert php pinterest - Télécharger - Langages
- 400 bad request request header or cookie too large - Forum Windows
- Php alert ✓ - Forum PHP
- MessageBox en PHP ✓ - Forum PHP
7 réponses
smoutsmout
Messages postés
160
Date d'inscription
lundi 26 mai 2008
Statut
Membre
Dernière intervention
9 janvier 2009
24 juin 2008 à 10:16
24 juin 2008 à 10:16
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
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
Utilisateur anonyme
24 juin 2008 à 10:16
24 juin 2008 à 10:16
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;
}
?>
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
smoutsmout
Messages postés
160
Date d'inscription
lundi 26 mai 2008
Statut
Membre
Dernière intervention
9 janvier 2009
24 juin 2008 à 10:31
24 juin 2008 à 10:31
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
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
smoutsmout
Messages postés
160
Date d'inscription
lundi 26 mai 2008
Statut
Membre
Dernière intervention
9 janvier 2009
24 juin 2008 à 10:35
24 juin 2008 à 10:35
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.
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.
Utilisateur anonyme
24 juin 2008 à 10:38
24 juin 2008 à 10:38
tant mieux
bon courage pour la suite
PS: n'oublie pas de cliquer sur resolu
++
bon courage pour la suite
PS: n'oublie pas de cliquer sur resolu
++