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,
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:
Code : Tout sélectionner
<?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>