Warning: Cannot modify header information – headers already sent
bonjour
j'ai essayé d'enlever tous les espaces mais il me donne une warning:
"Warning: Cannot modify header information - headers already sent by...."
voila mon code php :
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 70 71
|
<?php require_once('connexio.php'); ?>
<?php
if(isset($_POST['login']))
{ // on vérifie la présence des variables de formulaire (si le formulaire a été envoyé)
if(($_POST['login'] == ""))
{ // si login ou mot de passe non spécifiés >> message d'erreur
header("Location:affichage.php?erreur=empty");
}
else
{
?>
<H3>infos_jeux:</h3>
<table border>
<tr>
<th width ="20%">NOM</th>
<th width ="20px">Pocesseur</th>
<th width ="20px">console</th>
<th width ="20px">prix</th>
<th width ="20px">nbr_joueurs_max</th>
<th width ="20px">comentaire</th>
</tr>
<?php
$reponse = mysql_query("SELECT * FROM jeux_videos"); // Requête SQL
while ($donnees = mysql_fetch_array($reponse) )
{
if($donnees['prix']<=($_POST['login']) )
{
?>
<tr>
<td><? echo $donnees['nom']; ?></td>
<td><? echo $donnees['possesseur']; ?></td>
<td><? echo $donnees['prix']; ?> euros !</td>
<td><? echo $donnees['console']; ?></td>
<td><? echo $donnees['nbre_joueurs_max']; ?> au maximum/</td>
<td><? echo $donnees['commentaires']; ?></td>
</tr>
<?php }
}
mysql_close(); // Déconnexion de MySQL
?>
</table>
<?php
//@header("Location:affichage.php?add=ok"); // redirection si création réussie
}
}
?>
<HTML>
<HEAD>
<TITLE> entrer le nom du jeux </TITLE>
</HEAD>
<BODY>
<p>
<?php if(isset($_GET['add']) && ($_GET['add'] == "ok")) { // Affiche l'erreur ?>
<span class="reussite">L'utilisateur a été créé avec succès !</span>
<?php } ?>
<?php if(isset($_GET['erreur']) && ($_GET['erreur'] == "empty")) { // Affiche l'erreur ?>
<span class="erreur">Un petit oubli non ? Veuillez renseigner au moins un login et un mot de passe SVP</span>
<?php } ?>
</p>
<form action="" name="add" method="post">
entrer le prix maximal :
<input type="text" name="login"> <br/>
<input type="submit" name="livredor" value="voir les infos">
</form>
</BODY>
</HTML> |