Warning: Cannot modify header information
Résolu
Sinistrus
Messages postés
1010
Date d'inscription
Statut
Membre
Dernière intervention
-
CrazyWorld Messages postés 326 Date d'inscription Statut Membre Dernière intervention -
CrazyWorld Messages postés 326 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
J'ai deux problèmes ici et le premier est plus important que l'autre et je sollicite votre aide.
Avec ce code, j'obtiens cette erreur :
Voici mon code :
Et le second problème est sur celui-ci :
Je voudrais remplacer le bouton submit par ce code:
J'ai deux problèmes ici et le premier est plus important que l'autre et je sollicite votre aide.
Avec ce code, j'obtiens cette erreur :
Warning: Cannot modify header information - headers already sent by (output started at /home/xxx/domains/mondomaine.com/public_html/KeyProduct.php:10) in /home/xxx/domains/mondomaine.com/public_html/KeyProduct.php on line 12
Voici mon code :
<?php if (isset($_POST["Valid"])) { $Valid = $_POST["Valid"]; mysql_connect("localhost", "jaber2_testes", "KOcmGhVz"); mysql_select_db("jaber2_testes"); $req=mysql_query("select * from clevalidation where Validation='$Valid'"); $nb= mysql_num_rows($req); echo $nb; if ( $nb > 0 ) header('Location: Validite.php'); else header('Location: Invalidite.php'); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>HightSecurity</title> <style type="text/css"> <!-- body,td,th {font-family: Tahoma;font-size: 13px;} body {margin: 0px;} a.Verif {background:url(BoutonVerifier.png) no-repeat; width:89px; height:25px; display:block;} a.Verif:hover {background-position: bottom center;} --> </style> </head> <body> <table width="800" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="592" align="center" valign="middle" background="Ecran.jpg"> <form id="form1" name="form1" method="post" action=""> <input name="Valid" type="text" id="Valid" size="35" maxlength="25" /> <br /><br /> <input type="submit" name="button" id="button" value="Installer" /> <a href="#" class="Verif"></a> </form> </td> </tr> </table> </body> </html>
Et le second problème est sur celui-ci :
Je voudrais remplacer le bouton submit par ce code:
<a href="#" class="Verif"></a>
A voir également:
- Warning: Cannot modify header information
- Warning zone telechargement - Accueil - Outils
- Téléchargement et streaming illégal : voici les adresses des sites pirates que les FAI vont bloquer - Accueil - Services en ligne
- Cpu fan fail warning control - Forum Matériel & Système
- Symbole warning word ✓ - Forum Word
- Comment faire le symbole attention ✓ - Forum Loisirs / Divertissements
4 réponses
Salut, il faut aucun affichage avant la fonction Header, le soucis viens de la ligne 10
et pour remplacer le bouton submit
echo $nb;
et pour remplacer le bouton submit
<a href="javascript:void(0)" class="Verif" onclick="document.forms['form1'].submit();">Submit</a>
Salut,
Discussion abordée d'innombrable fois !
Première erreur : normal, tu envoi des données, donc ton header ne peux pas fonctionner, vire ton echo ca fonctionnera mieux.
Pour la deuxième question, essayes ca :
Discussion abordée d'innombrable fois !
Première erreur : normal, tu envoi des données, donc ton header ne peux pas fonctionner, vire ton echo ca fonctionnera mieux.
Pour la deuxième question, essayes ca :
<a href="javascript:;" onclick="this.submit()">envoyer</a>