Pb PHP
CSB
-
Utilisateur anonyme -
Utilisateur anonyme -
salut,
j'essaie de faire un code pour modifier un fichier texte en ligne à l'aide d'un formulaire :
<HTML>
<BODY>
<?php
$ligne=$_POST["ligne"];
$fp = fopen ("essai.txt","a");
fputs ($fp,"$ligne");
fputs ($fp,"\n");
fclose ($fp);
?>
<FORM name="citation" action="citations.php" method="post">
Saisie : <INPUT NAME="ligne"><INPUT TYPE="submit">
</FORM>
</BODY>
</HTML>
il fonctionne sauf que quand je le lance j'ai l'erreur suivante :
Notice: Undefined index: ligne in e:\program files\easyphp1-7\www\csb\citations.php on line 5
que faire pour enrayer cette erreur ???
d'avance merci ;-)
j'essaie de faire un code pour modifier un fichier texte en ligne à l'aide d'un formulaire :
<HTML>
<BODY>
<?php
$ligne=$_POST["ligne"];
$fp = fopen ("essai.txt","a");
fputs ($fp,"$ligne");
fputs ($fp,"\n");
fclose ($fp);
?>
<FORM name="citation" action="citations.php" method="post">
Saisie : <INPUT NAME="ligne"><INPUT TYPE="submit">
</FORM>
</BODY>
</HTML>
il fonctionne sauf que quand je le lance j'ai l'erreur suivante :
Notice: Undefined index: ligne in e:\program files\easyphp1-7\www\csb\citations.php on line 5
que faire pour enrayer cette erreur ???
d'avance merci ;-)
A voir également:
- Pb PHP
- Easy php - Télécharger - Divers Web & Internet
- Expert php pinterest - Télécharger - Langages
- Retour a la ligne php - Forum Webmastering
- Alert php - Forum PHP
- Get_magic_quotes_gpc php 8 ✓ - Forum PHP
1 réponse
Salut,
C'est normal.
Je modifierais ton code comme suivant:
Kalamit,
Parle à ma culasse, mon carter est malade. :)
C'est normal.
Je modifierais ton code comme suivant:
<HTML>
<BODY>
<?php
if (isset($_POST['ligne']) {
$ligne=$_POST['ligne'];
$fp = fopen ("essai.txt","a");
fputs ($fp,"$ligne");
fputs ($fp,"\n");
fclose ($fp);
}
?>
<FORM name="citation" action="citations.php" method="post">
Saisie : <INPUT NAME="ligne"><INPUT TYPE="submit">
</FORM>
</BODY>
</HTML>
Kalamit,
Parle à ma culasse, mon carter est malade. :)