Bonjour,
Voilà j'ai réussi à créer mon formulaire en php, il s'envoi parmail jusque là tout va bien. Mais je n'arrive pas à inclure dans l'envoi du mail, les champs prénom, tel, mobile ....
Pouvez-vous me dire comment je dois procéder ?
Merci d'avance
Ci-joint une capture du code de ma page :
<!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>Document sans titre</title>
<script type="text/javascript">
<!--
function MM_validateForm() { //v4.0
if (document.getElementById){
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
} }
//-->
</script>
</head>
<body>
<?php if ($_POST['message'] == "") { ?>
<form action="" method="post" enctype="multipart/form-data" name="form1" id="form1" onsubmit="MM_validateForm('nom','','R','prenom','','R','email','','RisEmail','tel','','R','message','','R');return document.MM_returnValue">
<table width="620" border="0">
<tr>
<td colspan="2">Nom :</td>
<td colspan="5"><label>
<input type="text" name="nom" id="nom" />
</label></td>
</tr>
<tr>
<td colspan="2">Prénom : </td>
<td colspan="5"><label>
<input type="text" name="prenom" id="prenom" />
</label></td>
</tr>
<tr>
<td colspan="2">E-mail :</td>
<td colspan="5"><label>
<input type="text" name="email" id="email" />
</label></td>
</tr>
<tr>
<td colspan="2">Adresse postale : </td>
<td colspan="5"><label>
<input type="text" name="adresse" id="adresse" />
</label></td>
</tr>
<tr>
<td colspan="2">Lieu</td>
<td colspan="5"><label>
<input type="text" name="lieu" id="lieu" />
</label></td>
</tr>
<tr>
<td colspan="2">Province/Etat</td>
<td colspan="5"><label>
<input type="text" name="province/etat" id="province/etat" />
</label></td>
</tr>
<tr>
<td colspan="2">NPA</td>
<td colspan="5"><label>
<input type="text" name="NPA" id="NPA" />
</label></td>
</tr>
<tr>
<td colspan="2">Pays </td>
<td colspan="5"><label>
<select name="pays" id="pays">
<OPTION value="Afghanistan">Afghanistan </OPTION>
<OPTION value="Afrique_Centrale">Afrique_Centrale </OPTION>
<OPTION value="Afrique_du_sud">Afrique_du_Sud </OPTION>
<OPTION value="Albanie">Albanie </OPTION>
<OPTION value="Algerie">Algerie </OPTION>
<OPTION value="Allemagne">Allemagne </OPTION>
<OPTION value="Andorre">Andorre </OPTION>
<OPTION value="Angola">Angola </OPTION>
<OPTION value="Anguilla">Anguilla </OPTION>
<OPTION value="Arabie_Saoudite">Arabie_Saoudite </OPTION>
<OPTION value="Argentine">Argentine </OPTION>
<OPTION value="Armenie">Armenie </OPTION>
<OPTION value="Australie">Australie </OPTION>
<OPTION value="Autriche">Autriche </OPTION>
<OPTION value="Azerbaidjan">Azerbaidjan </OPTION>
<OPTION value="Bahamas">Bahamas </OPTION>
<OPTION value="Bangladesh">Bangladesh </OPTION>
<OPTION value="Barbade">Barbade </OPTION>
<OPTION value="Bahrein">Bahrein </OPTION>
<OPTION value="Belgique">Belgique </OPTION>
<OPTION value="Belize">Belize </OPTION>
<OPTION value="Benin">Benin </OPTION>
<OPTION value="Bermudes">Bermudes </OPTION>
<OPTION value="Bielorussie">Bielorussie </OPTION>
<OPTION value="Bolivie">Bolivie </OPTION>
<OPTION value="Botswana">Botswana </OPTION>
<OPTION value="Bhoutan">Bhoutan </OPTION>
<OPTION value="Boznie_Herzegovine">Boznie_Herzegovine </OPTION>
<OPTION value="Bresil">Bresil </OPTION>
<OPTION value="Brunei">Brunei </OPTION>
<OPTION value="Bulgarie">Bulgarie </OPTION>
<OPTION value="Burkina_Faso">Burkina_Faso </OPTION>
<OPTION value="Burundi">Burundi </OPTION>
<OPTION value="Caiman">Caiman </OPTION>
<OPTION value="Cambodge">Cambodge </OPTION>
<OPTION value="Cameroun">Cameroun </OPTION>
<OPTION value="Canada">Canada </OPTION>
<OPTION value="Canaries">Canaries </OPTION>
<OPTION value="Cap_vert">Cap_Vert </OPTION>
<OPTION value="Chili">Chili </OPTION>
<OPTION value="Chine">Chine </OPTION>
<OPTION value="Chypre">Chypre </OPTION>
<OPTION value="Colombie">Colombie </OPTION>
<OPTION value="Comores">Colombie </OPTION>
<OPTION value="Congo">Congo </OPTION>
<OPTION value="Congo_democratique">Congo_democratique </OPTION>
<OPTION value="Coree_du_Nord">Coree_du_Nord </OPTION>
<OPTION value="Coree_du_Sud">Coree_du_Sud </OPTION>
<OPTION value="Costa_Rica">Costa_Rica </OPTION>
<OPTION value="Côte_d_Ivoire">Côte_d_Ivoire </OPTION>
<OPTION value="Croatie">Croatie </OPTION>
<OPTION value="Cuba">Cuba </OPTION>
<OPTION value="Danemark">Danemark </OPTION>
<OPTION value="Djibouti">Djibouti </OPTION>
<OPTION value="Dominique">Dominique </OPTION>
<OPTION value="Egypte">Egypte </OPTION>
<OPTION value="Emirats_Arabes_Unis">Emirats_Arabes_Unis </OPTION>
<OPTION value="Equateur">Equateur </OPTION>
<OPTION value="Erythree">Erythree </OPTION>
<OPTION value="Espagne">Espagne </OPTION>
<OPTION value="Estonie">Estonie </OPTION>
<OPTION value="Etats_Unis">Etats_Unis </OPTION>
<OPTION value="Ethiopie">Ethiopie </OPTION>
<OPTION value="Falkland">Falkland </OPTION>
<OPTION value="Feroe">Feroe </OPTION>
<OPTION value="Fidji">Fidji </OPTION>
<OPTION value="Finlande">Finlande </OPTION>
<OPTION value="France">France </OPTION>
<OPTION value="Gabon">Gabon </OPTION>
<OPTION value="Gambie">Gambie </OPTION>
<OPTION value="Georgie">Georgie </OPTION>
<OPTION value="Ghana">Ghana </OPTION>
<OPTION value="Gibraltar">Gibraltar </OPTION>
<OPTION value="Grece">Grece </OPTION>
<OPTION value="Grenade">Grenade </OPTION>
<OPTION value="Groenland">Groenland </OPTION>
<OPTION value="Guadeloupe">Guadeloupe </OPTION>
<OPTION value="Guam">Guam </OPTION>
<OPTION value="Guatemala">Guatemala</OPTION>
<OPTION value="Guernesey">Guernesey </OPTION>
<OPTION value="Guinee">Guinee </OPTION>
<OPTION value="Guinee_Bissau">Guinee_Bissau </OPTION>
<OPTION value="Guinee equatoriale">Guinee_Equatoriale </OPTION>
<OPTION value="Guyana">Guyana </OPTION>
<OPTION value="Guyane_Francaise ">Guyane_Francaise </OPTION>
<OPTION value="Haiti">Haiti </OPTION>
<OPTION value="Hawaii">Hawaii </OPTION>
<OPTION value="Honduras">Honduras </OPTION>
<OPTION value="Hong_Kong">Hong_Kong </OPTION>
<OPTION value="Hongrie">Hongrie </OPTION>
<OPTION value="Inde">Inde </OPTION>
<OPTION value="Indonesie">Indonesie </OPTION>
<OPTION value="Iran">Iran </OPTION>
<OPTION value="Iraq">Iraq </OPTION>
<OPTION value="Irlande">Irlande </OPTION>
<OPTION value="Islande">Islande </OPTION>
<OPTION value="Israel">Israel </OPTION>
<OPTION value="Italie">italie </OPTION>
<OPTION value="Jamaique">Jamaique </OPTION>
<OPTION value="Jan Mayen">Jan Mayen </OPTION>
<OPTION value="Japon">Japon </OPTION>
<OPTION value="Jersey">Jersey </OPTION>
<OPTION value="Jordanie">Jordanie </OPTION>
<OPTION value="Kazakhstan">Kazakhstan </OPTION>
<OPTION value="Kenya">Kenya </OPTION>
<OPTION value="Kirghizstan">Kirghizistan </OPTION>
<OPTION value="Kiribati">Kiribati </OPTION>
<OPTION value="Koweit">Koweit </OPTION>
<OPTION value="Laos">Laos </OPTION>
<OPTION value="Lesotho">Lesotho </OPTION>
<OPTION value="Lettonie">Lettonie </OPTION>
<OPTION value="Liban">Liban </OPTION>
<OPTION value="Liberia">Liberia </OPTION>
<OPTION value="Liechtenstein">Liechtenstein </OPTION>
<OPTION value="Lituanie">Lituanie </OPTION>
<OPTION value="Luxembourg">Luxembourg </OPTION>
<OPTION value="Lybie">Lybie </OPTION>
<OPTION value="Macao">Macao </OPTION>
<OPTION value="Macedoine">Macedoine </OPTION>
<OPTION value="Madagascar">Madagascar </OPTION>
<OPTION value="Madère">Madère </OPTION>
<OPTION value="Malaisie">Malaisie </OPTION>
<OPTION value="Malawi">Malawi </OPTION>
<OPTION value="Maldives">Maldives </OPTION>
<OPTION value="Mali">Mali </OPTION>
<OPTION value="Malte">Malte </OPTION>
<OPTION value="Man">Man </OPTION>
<OPTION value="Mariannes du Nord">Mariannes du Nord </OPTION>
<OPTION value="Maroc">Maroc </OPTION>
<OPTION value="Marshall">Marshall </OPTION>
<OPTION value="Martinique">Martinique </OPTION>
<OPTION value="Maurice">Maurice </OPTION>
<OPTION value="Mauritanie">Mauritanie </OPTION>
<OPTION value="Mayotte">Mayotte </OPTION>
<OPTION value="Mexique">Mexique </OPTION>
<OPTION value="Micronesie">Micronesie </OPTION>
<OPTION value="Midway">Midway </OPTION>
<OPTION value="Moldavie">Moldavie </OPTION>
<OPTION value="Monaco">Monaco </OPTION>
<OPTION value="Mongolie">Mongolie </OPTION>
<OPTION value="Montserrat">Montserrat </OPTION>
<OPTION value="Mozambique">Mozambique </OPTION>
<OPTION value="Namibie">Namibie </OPTION>
<OPTION value="Nauru">Nauru </OPTION>
<OPTION value="Nepal">Nepal </OPTION>
<OPTION value="Nicaragua">Nicaragua </OPTION>
<OPTION value="Niger">Niger </OPTION>
<OPTION value="Nigeria">Nigeria </OPTION>
<OPTION value="Niue">Niue </OPTION>
<OPTION value="Norfolk">Norfolk </OPTION>
<OPTION value="Norvege">Norvege </OPTION>
<OPTION value="Nouvelle_Caledonie">Nouvelle_Caledonie </OPTION>
<OPTION value="Nouvelle_Zelande">Nouvelle_Zelande </OPTION>
<OPTION value="Oman">Oman </OPTION>
<OPTION value="Ouganda">Ouganda </OPTION>
<OPTION value="Ouzbekistan">Ouzbekistan </OPTION>
<OPTION value="Pakistan">Pakistan </OPTION>
<OPTION value="Palau">Palau </OPTION>
<OPTION value="Palestine">Palestine </OPTION>
<OPTION value="Panama">Panama </OPTION>
<OPTION value="Papouasie_Nouvelle_Guinee">Papouasie_Nouvelle_Guinee </OPTION>
<OPTION value="Paraguay">Paraguay </OPTION>
<OPTION value="Pays_Bas">Pays_Bas </OPTION>
<OPTION value="Perou">Perou </OPTION>
<OPTION value="Philippines">Philippines </OPTION>
<OPTION value="Pologne">Pologne </OPTION>
<OPTION value="Polynesie">Polynesie </OPTION>
<OPTION value="Porto_Rico">Porto_Rico </OPTION>
<OPTION value="Portugal">Portugal </OPTION>
<OPTION value="Qatar">Qatar </OPTION>
<OPTION value="Republique_Dominicaine">Republique_Dominicaine </OPTION>
<OPTION value="Republique_Tcheque">Republique_Tcheque </OPTION>
<OPTION value="Reunion">Reunion </OPTION>
<OPTION value="Roumanie">Roumanie </OPTION>
<OPTION value="Royaume_Uni">Royaume_Uni </OPTION>
<OPTION value="Russie">Russie </OPTION>
<OPTION value="Rwanda">Rwanda </OPTION>
<OPTION value="Sahara Occidental">Sahara Occidental </OPTION>
<OPTION value="Sainte_Lucie">Sainte_Lucie </OPTION>
<OPTION value="Saint_Marin">Saint_Marin </OPTION>
<OPTION value="Salomon">Salomon </OPTION>
<OPTION value="Salvador">Salvador </OPTION>
<OPTION value="Samoa_Occidentales">Samoa_Occidentales</OPTION>
<OPTION value="Samoa_Americaine">Samoa_Americaine </OPTION>
<OPTION value="Sao_Tome_et_Principe">Sao_Tome_et_Principe </OPTION>
<OPTION value="Senegal">Senegal </OPTION>
<OPTION value="Seychelles">Seychelles </OPTION>
<OPTION value="Sierra Leone">Sierra Leone </OPTION>
<OPTION value="Singapour">Singapour </OPTION>
<OPTION value="Slovaquie">Slovaquie </OPTION>
<OPTION value="Slovenie">Slovenie</OPTION>
<OPTION value="Somalie">Somalie </OPTION>
<OPTION value="Soudan">Soudan </OPTION>
<OPTION value="Sri_Lanka">Sri_Lanka </OPTION>
<OPTION value="Suede">Suede </OPTION>
<OPTION value="Suisse" selected>Suisse </OPTION>
<OPTION value="Surinam">Surinam </OPTION>
<OPTION value="Swaziland">Swaziland </OPTION>
<OPTION value="Syrie">Syrie </OPTION>
<OPTION value="Tadjikistan">Tadjikistan </OPTION>
<OPTION value="Taiwan">Taiwan </OPTION>
<OPTION value="Tonga">Tonga </OPTION>
<OPTION value="Tanzanie">Tanzanie </OPTION>
<OPTION value="Tchad">Tchad </OPTION>
<OPTION value="Thailande">Thailande </OPTION>
<OPTION value="Tibet">Tibet </OPTION>
<OPTION value="Timor_Oriental">Timor_Oriental </OPTION>
<OPTION value="Togo">Togo </OPTION>
<OPTION value="Trinite_et_Tobago">Trinite_et_Tobago </OPTION>
<OPTION value="Tristan da cunha">Tristan de cuncha </OPTION>
<OPTION value="Tunisie">Tunisie </OPTION>
<OPTION value="Turkmenistan">Turmenistan </OPTION>
<OPTION value="Turquie">Turquie </OPTION>
<OPTION value="Ukraine">Ukraine </OPTION>
<OPTION value="Uruguay">Uruguay </OPTION>
<OPTION value="Vanuatu">Vanuatu </OPTION>
<OPTION value="Vatican">Vatican </OPTION>
<OPTION value="Venezuela">Venezuela </OPTION>
<OPTION value="Vierges_Americaines">Vierges_Americaines </OPTION>
<OPTION value="Vierges_Britanniques">Vierges_Britanniques </OPTION>
<OPTION value="Vietnam">Vietnam </OPTION>
<OPTION value="Wake">Wake </OPTION>
<OPTION value="Walllis et Futuma">Wallis et Futuma </OPTION>
<OPTION value="Yemen">Yemen </OPTION>
<OPTION value="Yougoslavie">Yougoslavie </OPTION>
<OPTION value="Zambie">Zambie </OPTION>
<OPTION value="Zimbabwe">Zimbabwe </OPTION>
</select>
</label></td>
</tr>
<tr>
<td colspan="2">Téléphone </td>
<td colspan="5"><label>
<input type="text" name="tel" id="tel" />
</label></td>
</tr>
<tr>
<td colspan="2">Mobile </td>
<td colspan="5"><label>
<input type="text" name="mobile" id="mobile" />
</label></td>
</tr>
<tr>
<td colspan="2">Fax</td>
<td colspan="5"><label>
<input type="text" name="fax" id="fax" />
</label></td>
</tr>
<tr>
<td width="63">Chien(s) nombre </td>
<td width="155"><label>
<input type="text" name="nbr_chiens" id="nbr_chiens" />
</label></td>
<td width="37">Race</td>
<td width="155"><label>
<input type="text" name="race_chien" id="race_chien" />
</label></td>
<td width="47">Nom(s)</td>
<td colspan="2"><label>
<input type="text" name="nom chien" id="nom chien" />
</label></td>
</tr>
<tr>
<td>Chat(s) nombre </td>
<td><label>
<input type="text" name="nbr_chats" id="nbr_chats" />
</label></td>
<td>Race</td>
<td><label>
<input type="text" name="chat_race" id="chat_race" />
</label></td>
<td>Nom(s)</td>
<td colspan="2"><label>
<input type="text" name="nom_chat" id="nom_chat" />
</label></td>
</tr>
<tr>
<td colspan="7">Sujet :
<label>
<input name="sujet" type="text" id="sujet" size="60" />
</label></td>
</tr>
<tr>
<td colspan="7"><p>Message :</p>
<p>
<label>
<textarea name="message" id="message" cols="100" rows="10"></textarea>
</label>
</p></td>
</tr>
<tr>
<td colspan="5"> </td>
<td width="69"><label>
<input type="submit" name="envoi" id="envoi" value="Envoyer" />
</label></td>
<td width="58"><label>
<input type="reset" name="effacer" id="effacer" value="Effacer" />
</label></td>
</tr>
</table>
</form>
<?php } else {
mail("MON_MAIL", $_POST['sujet'], $_POST['message'],"From: ".$_POST['nom']."<".$_POST['email'].">");
?>
<p>Le message a bien été envoyé, merci.</p>
<?php } ?>
</body>
</html>
Afficher la suite