Bonjour,
J'utilise depuis plusieurs années une script sendmail pour formulaire.
Aujourd'hui je me rends compte qu'il ne fonctionne plus.
En effet je ne reçoit plus l'intégralité des champs.
Hébergement chez O2Switch.
Je reçoit donc en objet le prénom et dans le corps du message seul l'adresse Mail apparaît.
Une idée ?
Merci.
Forulaire HTML :
Traitement.phpCode:
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 <!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>Formulaire de réservation</title> <link href="css/style.css" rel="stylesheet" type="text/css" </head> <body> <form method="post" action="php/traitement.php"> <p class="titre">Coordonnées</p> <fieldset id="coordonnees"> <table width="410"> <tr> <td width="100"><p id="civilite"><label>Civilité : </label></p></td> <td width="60"><input type="radio" name="civilite" value="Fille" />Fille</td> <td width="60"><input type="radio" name="civilite" value="Garcon" />Garcon</td> </tr> <tr> <td><label>Prénom : </label></td> <td colspan="3"><input type="text" name="prenom" size="30" /></td> </tr> <tr> <td><label>Age : </label></td> <td colspan="3"><input type="text" name="age" size="30" /></td> </tr> <tr> <td><label>Ville : </label></td> <td colspan="3"><input type="text" name="ville" size="30" /></td> </tr> <tr> <td><label>E-Mail : </label></td> <td colspan="3"><input type="text" name="mails" size="30" /></td> </tr> <p id="buttons"> <input type="submit" value="Envoyer" /> </p> </form> </body> </html>
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14 <?php $To = 'XXXX@gmail.com'; $From = $_POST["mails"]; $subject = $_POST["prenom"]; $message = ''; while (list($key, $val) = each($HTTP_POST_VARS)) { $message .= "$key : $val\n"; } mail($To, $subject, $message, $From); header ('Location: ../merci.html'); ?>