Probleme de ligne pour formulaire ds fichier

delbilcos -  
delbilcos Messages postés 14 Statut Membre -
Bonjour, j'ai fait un formulaire, et la gestion de celui ci est en php. je souhaite envoyer les données dans un fichier .txt. Jusque là, aucun souci.
Mais je me retrouve avec "Nom: xhfPrénom: seryStatut: formateurCommentaire: qerhyNom: dhjPrénom: ergStatut: formateurCommentaire: qerh" dans mon fichier...
J'aimerai avoir par exemple

"Nom : lsjf
Prénom : msjqf
Statut : jqf
Commentaire : ^qkfo

Nom : wjf
...
"

Voici mon code, merci pour votre aide :

$comment = fopen("commentaire.txt","a+"
fputs($comment, "Nom: ");
fputs($comment, $_POST['nom']);
//fputs($comment, "<BR>");

fputs($comment, "Prénom: ");
fputs($comment, $_POST['prenom']);
//fputs($comment, '<BR>');

fputs($comment, "Statut: ");
fputs($comment, $_POST['statut']);
//fputs($comment, "<BR>");

fputs($comment, "Commentaire: ");
fputs($comment, $_POST['comment']);
A voir également:

3 réponses

isis59
 
/n permet de faire un retour a la ligne donc normalement si tu fait fputs ($comment, '/n' ) ça devrait marcher. et le < br /> n'a pas fonctionné?
0
isis59
 
ou meme

fputs($comment, $_POST['nom']."/n");

enfin je crois ^^
0
delbilcos Messages postés 14 Statut Membre 1
 
Rien de tout cela ne marche... ni le br, ni le /n :s
Je commence à me demander s'il n'y a pas un problème du fait que j'envoie dans un fichier .txt et non dans un mail....
0