Bonjour tout le monde
Je suis tout nouveau sur ce site web j'espère dans le futur pouvoir contribuer![]()
Mais aujourd'hui je suis face a un problème assez récurent, je m'explique:
Je dispose d'un formulaire codé d'une partie en PHP et d'une autre en html, j'y est intégrer plusieurs champs tels que:
Prénom/Nom
Fonction
Tel
Portable
Fax
Adresse
Code postal/ville
Evénement important
Mais je suis face a un problème avec le champ Evénement important,ah j'oublie une fois ce formulaire valider un script force le téléchargement vers le pc de la personne.
Ceci lui génère un fichier html (en gros a l'intérieur c'est une signature qui est crée)
Mais le HIC est le suivant : lorsque le champ Evénement important est compléter celui ci ne prend pas en compte les saut de ligne tout le texte tien que sur une ligne (dans le fichier html générer)![]()
J'aurais souhaitais que mon script puisse comprendre quand une personne saute la ligne dans le champ Evénement important
Voici le fichier:
Merci d'avance pour votre aide
Code php : Sélectionner tout - Visualiser dans une fenêtre à part
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100 <?PHP if (isset($_POST['soumettre'])){ $nom=$_POST['nom']; $tel=$_POST['tel']; $portable=$_POST['portable']; $fonction=$_POST['fonction']; $fax=$_POST['fax']; $adresse=$_POST['adresse']; $codepostal=$_POST['codepostal']; $evenement=$_POST['evenement']; header('Content-disposition: attachment; filename=signature.htm'); header('Content-Type: application/force-download'); header('Content-Transfer-Encoding: fichier'); header('Pragma: no-cache'); header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); header('Expires: 0'); echo "<strong>$nom</strong><br>"; if ($fonction!="") echo "$fonction<br>"; if ($tel!="") echo "Tel: $tel<br>"; if ($portable!="") echo "Port: $portable<br>"; if ($fax!="") echo "Fax: $fax<br>"; if ($adresse!="") echo "$adresse<br>"; if ($codepostal!="") echo "$codepostal<br>"; if ($evenement!="") echo "$evenement<br>"; exit(); } ?> <html><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>signature.</title> <style type="text/css"> <!-- .Style1 { font-size: 16px; font-weight: bold; } .Style2 { color: #FF0000; font-weight: bold; } .Style3 {font-size: 24px; font-weight: bold; } --> </style> </head> <body> <form name='formulaire' method='post'> <p align="center" class="Style3">Création de votre signature</p> <p class="Style1"> </p> <table> <th> </th> <br> <tr> <td>Prénom/Nom</td> <td><input name='nom' type='text' size='50'></td></tr> <tr> <tr> <td>Fonction</td> <td><input name='fonction' type='text' id="fonction" size='50'></td></tr> <tr> <td>Tel</td> <td><input name='tel' type='text' id="tel" size='50'></td></tr> <tr> <td>Portable</td> <td><input name='portable' type='text' id="portable" size='50'></td></tr> <td>Fax</td> <td><input name='fax' type='text' id="fax" size='50'></td></tr> <td>Adresse</td> <td><input name='adresse' type='text' id="adresse" size='50'></td></tr> <td>Code postal/ville</td> <td><input name='codepostal' type='text' id="codepostal" size='50'></td></tr> <td>Evénement important</td> <td><textarea WRAP="hard" name="evenement" COLS="50" rows="5" ></textarea></td></tr> <td> </td> <td> <input name='soumettre' type='submit' value='Valider'></td></tr> </table> <p> </p> </form> </body> </html>
Partager