Email se vide

Fermé
Kawsinoki - 3 mars 2009 à 11:49
jojodivx Messages postés 193 Date d'inscription dimanche 14 décembre 2008 Statut Membre Dernière intervention 9 avril 2009 - 3 mars 2009 à 22:47
Bonjour,
j'ai fait un petit script (que j'ai galéré :D) pour envoyer un formulaire de recrutement par email, mais il ne marche pas les variables ne s'affichent pas dans l'email...

Voici form.php:

========================================================
<form action="send.php" method="get" name="form1" class="style3">
<table width="95%" border="0" align="center" cellpadding="2" cellspacing="2">
<tr>
<th height="52" colspan="2" class="th">Formulaire de recrutement</th>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2" class="imputobligatoire style1"><div align="center">Attention, les formulaires rouges sont obligatoires, les verts sont facultatifs!</div></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td height="39" colspan="2"><h2 class="tr"><strong>1- Vos coordonnees</strong></h2></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr class="cellule">
<td width="23%" class="tr2">Nom</td>
<td width="73%" ><input name="nom" type="text" class="imputobligatoire" id="nom" maxlength="50"></td>
</tr>
<tr class="cellule">
<td class="tr2" >Prénom</td>
<td ><input name="prenom" type="text" class="imputobligatoire" id="prenom" maxlength="50"></td>
</tr>
<tr class="cellule">
<td class="tr2" >Civilité</td>
<td ><select name="civilite" class="imputobligatoire" id="civilite">
<option>MR</option>
<option>MME</option>
<option>MLLE</option>
</select> </td>
</tr>
<tr class="cellule">
<td class="tr2" >Date de naissance</td>
<td ><select name="date-jours" class="imputobligatoire" id="date-jours">
<option>01</option>
<option>02</option>
<option>03</option>
<option>04</option>
<option>05</option>
<option>06</option>
<option>07</option>
<option>08</option>
<option>09</option>
<option>10</option>
<option>11</option>
<option>12</option>
<option>13</option>
<option>14</option>
<option>15</option>
<option>16</option>
<option>17</option>
<option>18</option>
<option>19</option>
<option>20</option>
<option>21</option>
<option>22</option>
<option>23</option>
<option>24</option>
<option>25</option>
<option>26</option>
<option>27</option>
<option>28</option>
<option>29</option>
<option>30</option>
<option>31</option>
</select>
/
<select name="date-mois" class="imputobligatoire" id="date-mois">
<option>JANVIER</option>
<option>FEVRER</option>
<option>MARS</option>
<option>AVRIL</option>
<option>MAI</option>
<option>JUIN</option>
<option>JUILLET</option>
<option>AOUT</option>
<option>SEPTEMBRE</option>
<option>OCTOBRE</option>
<option>NOVEMBRE</option>
<option>DECEMBRE</option>
</select>
/
<select name="date-annee" class="imputobligatoire" id="date-annee">
<option>1945</option>
<option>1946</option>
<option>1947</option>
<option>1948</option>
<option>1949</option>

<option>1950</option>
<option>1951</option>
<option>1952</option>
<option>1953</option>
<option>1954</option>
<option>1955</option>

<option>1956</option>
<option>1957</option>
<option>1958</option>
<option>1959</option>
<option>1960</option>
<option>1961</option>

<option>1962</option>
<option>1963</option>
<option>1964</option>
<option>1965</option>
<option>1966</option>
<option>1967</option>

<option>1968</option>
<option>1969</option>
<option>1970</option>
<option>1971</option>
<option>1972</option>
<option>1973</option>

<option>1974</option>
<option>1975</option>
<option>1976</option>
<option>1977</option>
<option>1978</option>
<option>1979</option>

<option>1980</option>
<option>1981</option>
<option>1982</option>
<option>1983</option>
<option>1984</option>
<option>1985</option>

<option>1986</option>
<option>1987</option>
<option>1988</option>
<option>1989</option>
<option>1990</option>
<option>1991</option>

<option>1992</option>
<option>1993</option>
<option>1994</option>
<option>1995</option>
<option>1996</option>
<option>1997</option>

<option>1998</option>
<option>1999</option>
<option>2000</option>
<option>2001</option>
<option>2002</option>
<option>2003</option>

<option>2004</option>
<option>2005</option>
<option>2006</option>
<option>2007</option>
<option>2008</option>
<option>2009</option>
</select> </td>
</tr>
<tr class="cellule">
<td class="tr2" >Lieu de naissance</td>
<td ><input name="lieu-de-naissance" type="text" class="imputobligatoire" id="lieu-de-naissance"></td>
</tr>

<tr class="cellule">
<td class="tr2" >Situation vis à vis du service National</td>
<td ><input name="situation-nationale" type="text" class="imputobligatoire" id="situation-nationale"></td>
</tr>
<tr class="cellule">
<td class="tr2" >Adresse personelle</td>
<td ><p>
<input name="adresse-numero" type="text" class="imputobligatoire" id="adresse-numero" value="N°" size="4" maxlength="5">
-
<select name="adresse-type" class="imputobligatoire" id="adresse-type">
<option value="" selected>[CHOIX]</option>
<option value="ALL" >Allée</option>
<option value="ARC" >Arcades</option>
<option value="AV" >Avenue</option>

<option value="BOIS" >Bois</option>
<option value="BD" >Boulevard</option>
<option value="BUT" >Butte</option>
<option value="CARR" >Carré</option>
<option value="CAR" >Carrefour</option>
<option value="CHS" >Chaussée</option>

<option value="CHE" >Chemin</option>
<option value="CITE" >Cité</option>
<option value="CLOS" >Clos</option>
<option value="COTE" >Côteau</option>
<option value="COUR" >Cour</option>
<option value="CRS" >Cours</option>

<option value="DOM" >Domaine</option>
<option value="ESP" >Esplanade</option>
<option value="FG" >Faubourg</option>
<option value="FOS" >Fosse</option>
<option value="HAM" >Hameau</option>
<option value="IMP" >Impasse</option>

<option value="JARD" >Jardin</option>
<option value="LD" >Lieu Dit</option>
<option value="LOT" >Lotissement</option>
<option value="MAIL" >Mail</option>
<option value="PARC" >Parc</option>
<option value="PRV" >Parvis</option>

<option value="PAS" >Passage</option>
<option value="PLE" >Passerelle</option>
<option value="PAT" >Patio</option>
<option value="PAV" >Pavillon</option>
<option value="PL" >Place</option>
<option value="PTE" >Porte</option>

<option value="POT" >Poterne</option>
<option value="PROM" >Promenade</option>
<option value="QU" >Quai</option>
<option value="QUA" >Quartier</option>
<option value="RES" >Résidence</option>
<option value="ROC" >Rocade</option>

<option value="RPT" >Rond Point</option>
<option value="RTE" >Route</option>
<option value="RUE" >Rue</option>
<option value="RLE" >Ruelle</option>
<option value="SEN" >Sente(ier)</option>
<option value="SQ" >Square</option>

<option value="TSSE" >Terrasse</option>
<option value="VEN" >Venelle</option>
<option value="VLA" >Villa</option>
<option value="VOI" >Voie</option>
</select>
-
<input name="adresse" type="text" class="imputobligatoire" id="adresse" value="Adresse.." size="50" maxlength="200">
</p>
<p>
<input name="adresse-code-postal" type="text" class="imputobligatoire" id="adresse-code-postal" value="Code postal" size="10" maxlength="10">
-
<input name="adresse-commune" type="text" class="imputobligatoire" id="adresse-commune" value="Commune">
-

<input name="willaya" type="text" class="imputobligatoire" id="willaya" value="Willaya">
</p></td>
</tr>
<tr class="cellule">
<td class="tr2" >Nombre d'enfants</td>
<td ><select name="enfants" class="imputobligatoire" id="enfants">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7 ou +</option>
</select> </td>
</tr>
<tr class="cellule">
<td class="tr2" >Nationnalité</td>
<td ><input name="nationnalité" type="text" class="imputobligatoire" id="nationnalité"></td>
</tr>
<tr class="cellule">
<td class="tr2" >Téléphone fixe</td>
<td ><input name="telephone-fixe" type="text" class="imputobligatoire" id="telephone-fixe"></td>
</tr>
<tr class="cellule">
<td class="tr2" >Téléphone mobile</td>
<td ><input name="telephone-mobile" type="text" class="imputobligatoire" id="telephone-mobile"></td>
</tr>
<tr class="cellule">
<td class="tr2" >Adresse email personelle</td>
<td ><input name="mail" type="text" class="imputobligatoire" id="mail" value="@" size="60" maxlength="60"></td>
</tr>
<tr class="cellule">
<td class="imputfacultatif" >Photo d'identité</td>
<td ><input name="photo" type="file" class="imputfacultatif" id="photo"></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td height="39" colspan="2"><h2 class="tr"><strong>2- Niveau d'etudes</strong></h2></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr class="cellule">
<td class="tr2" >Diplome obtenu</td>
<td ><select name="etudes" class="imputobligatoire">
<option value="-1" >Choisissez</option>

<option value="0" >Sans diplôme</option>
<option value="1" >Diplôme national du brevet</option>
<option value="2" >CAP/BEP</option>
<option value="3" >Niveau BAC</option>
<option value="4" >BAC</option>

<option value="5" >BAC+1</option>
<option value="6" >BAC+2</option>
<option value="7" >BAC+3</option>
<option value="8" >BAC+4</option>
<option value="9" >BAC+5 et plus</option>
</select></td>
</tr>
<tr class="cellule">
<td class="tr2" >Précisions</td>
<td ><textarea name="precisions-niveau-etudes" cols="45" rows="5" class="imputobligatoire" id="precisions-niveau-etudes"></textarea></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td height="39" colspan="2"><h2 class="tr"><strong>3- Formations SupplEmentaires</strong></h2></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr class="cellule">
<td class="tr2" ><span class="style2">Année</span></td>
<td ><input name="annee-formations" type="text" class="imputfacultatif" id="annee-formations" size="4" maxlength="4"></td>
</tr>
<tr class="cellule">
<td class="tr2" ><span class="style2">Certificat</span></td>
<td ><input name="certificat" type="text" class="imputfacultatif" id="certificat"></td>
</tr>
<tr class="cellule">
<td class="tr2" ><span class="style2">Spécialité</span></td>
<td ><input name="specialite" type="text" class="imputfacultatif" id="specialite"></td>
</tr>
<tr class="cellule">
<td class="tr2" ><span class="style2">Etablissement</span></td>
<td ><input name="etablissement" type="text" class="imputfacultatif" id="etablissement"></td>
</tr>
<tr class="cellule">
<td class="tr2" ><span class="style2">Précisions</span></td>
<td ><textarea name="precisions-formation" cols="45" rows="5" class="imputfacultatif" id="precisions-formation"></textarea></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td height="39" colspan="2"><h2 class="tr"><strong>4- Experience professionnelle</strong></h2></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr class="cellule">
<td class="tr2" >Expérience professionnelle</td>
<td ><p>
<label>
<input name="xpoui" type="radio" class="imputobligatoire" id="XP professionnelle_0" value="Oui" checked>
Oui</label>
<br>
<label>
<input name="xpoui" type="radio" class="imputobligatoire" id="XP professionnelle_1" value="Oui">
Non</label>
<br>
</p></td>
</tr>
<tr class="cellule">
<td class="imputobligatoire" >Si oui, précisez:</td>
<td ><textarea name="XP-pro-precision" cols="45" rows="5" class="imputfacultatif" id="XP-pro-precision"></textarea></td>
</tr>
<tr class="cellule">
<td class="tr2" >De </td>
<td ><select name="xp-pro-de" class="imputfacultatif" id="xp-pro-de">
<option>JANVIER</option>
<option>FEVRER</option>
<option>MARS</option>
<option>AVRIL</option>
<option>MAI</option>
<option>JUIN</option>
<option>JUILLET</option>
<option>AOUT</option>
<option>SEPTEMBRE</option>
<option>OCTOBRE</option>
<option>NOVEMBRE</option>
<option>DECEMBRE</option>
</select>
/
<select name="xp-pro-de-annee" class="imputfacultatif" id="xp-pro-de-annee">
<option>1945</option>
<option>1946</option>
<option>1947</option>
<option>1948</option>
<option>1949</option>

<option>1950</option>
<option>1951</option>
<option>1952</option>
<option>1953</option>
<option>1954</option>
<option>1955</option>

<option>1956</option>
<option>1957</option>
<option>1958</option>
<option>1959</option>
<option>1960</option>
<option>1961</option>

<option>1962</option>
<option>1963</option>
<option>1964</option>
<option>1965</option>
<option>1966</option>
<option>1967</option>

<option>1968</option>
<option>1969</option>
<option>1970</option>
<option>1971</option>
<option>1972</option>
<option>1973</option>

<option>1974</option>
<option>1975</option>
<option>1976</option>
<option>1977</option>
<option>1978</option>
<option>1979</option>

<option>1980</option>
<option>1981</option>
<option>1982</option>
<option>1983</option>
<option>1984</option>
<option>1985</option>

<option>1986</option>
<option>1987</option>
<option>1988</option>
<option>1989</option>
<option>1990</option>
<option>1991</option>

<option>1992</option>
<option>1993</option>
<option>1994</option>
<option>1995</option>
<option>1996</option>
<option>1997</option>

<option>1998</option>
<option>1999</option>
<option>2000</option>
<option>2001</option>
<option>2002</option>
<option>2003</option>

<option>2004</option>
<option>2005</option>
<option>2006</option>
<option>2007</option>
<option>2008</option>
<option>2009</option>
</select> </td>
</tr>
<tr class="cellule">
<td class="tr2" >A</td>
<td ><select name="xp-pro-a" class="imputfacultatif" id="xp-pro-a">
<option>JANVIER</option>
<option>FEVRER</option>
<option>MARS</option>
<option>AVRIL</option>
<option>MAI</option>
<option>JUIN</option>
<option>JUILLET</option>
<option>AOUT</option>
<option>SEPTEMBRE</option>
<option>OCTOBRE</option>
<option>NOVEMBRE</option>
<option>DECEMBRE</option>
</select>
/
<select name="xp-pro-de-annee2" class="imputfacultatif" id="xp-pro-de-annee2">
<option>1945</option>
<option>1946</option>
<option>1947</option>
<option>1948</option>
<option>1949</option>

<option>1950</option>
<option>1951</option>
<option>1952</option>
<option>1953</option>
<option>1954</option>
<option>1955</option>

<option>1956</option>
<option>1957</option>
<option>1958</option>
<option>1959</option>
<option>1960</option>
<option>1961</option>

<option>1962</option>
<option>1963</option>
<option>1964</option>
<option>1965</option>
<option>1966</option>
<option>1967</option>

<option>1968</option>
<option>1969</option>
<option>1970</option>
<option>1971</option>
<option>1972</option>
<option>1973</option>

<option>1974</option>
<option>1975</option>
<option>1976</option>
<option>1977</option>
<option>1978</option>
<option>1979</option>

<option>1980</option>
<option>1981</option>
<option>1982</option>
<option>1983</option>
<option>1984</option>
<option>1985</option>

<option>1986</option>
<option>1987</option>
<option>1988</option>
<option>1989</option>
<option>1990</option>
<option>1991</option>

<option>1992</option>
<option>1993</option>
<option>1994</option>
<option>1995</option>
<option>1996</option>
<option>1997</option>

<option>1998</option>
<option>1999</option>
<option>2000</option>
<option>2001</option>
<option>2002</option>
<option>2003</option>

<option>2004</option>
<option>2005</option>
<option>2006</option>
<option>2007</option>
<option>2008</option>
<option>2009</option>
</select></td>
</tr>
<tr class="cellule">
<td class="tr2" >Poste occupé</td>
<td ><input name="xp-pro-poste" type="text" class="imputfacultatif" id="xp-pro-poste" maxlength="90"></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td height="39" colspan="2"><h2 class="tr"><strong>5- Domainde d'activite desire</strong></h2></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr class="cellule">
<td class="tr2" >Domaine</td>
<td ><select name="domaine" size="1" class="imputobligatoire" id="domaine">
<option selected>Ressources humaines</option>
<option>Marketing</option>
<option>Communications</option>
<option>Finances</option>
<option>Technique</option>
<option>Logistique</option>
</select> </td>
</tr>
<tr class="cellule">
<td class="tr2" >Veux de lieu d'affectition prioritaire</td>
<td ><select name="affectation1" class="imputobligatoire" id="affectation1">
<option selected>Alger</option>
<option>Hassi messaoud</option>
<option>Hassi rmel</option>
<option>Arzew</option>
<option>Skikda</option>
</select> </td>
</tr>
<tr class="cellule">
<td class="tr2" >Veux de lieu d'affectition secondaire</td>
<td ><select name="affectation2" class="imputobligatoire" id="affectation2">
<option selected>Alger</option>
<option>Hassi messaoud</option>
<option>Hassi rmel</option>
<option>Arzew</option>
<option>Skikda</option>
</select></td>
</tr>
<tr class="cellule">
<td class="imputobligatoire" >Disponibilité</td>
<td ><p>
<label>
<input name="dispo" type="radio" class="imputobligatoire" id="dispo_0" value="Immédiate" checked>
Immédiate</label>
<br>
<label>
<input name="dispo" type="radio" class="imputobligatoire" id="dispo_1" value="1 semaine">
1 Semaine</label>
<br>
<label>
<input name="dispo" type="radio" class="imputobligatoire" id="dispo_2" value="15 jours">
15 Jours</label>
<br>
<label>
<input name="dispo" type="radio" class="imputobligatoire" id="dispo_3" value="1 mois">
1 Mois</label>
<br>
<label>
<input name="dispo" type="radio" class="imputobligatoire" id="dispo_4" value="2 mois">
2 Mois</label>
<br>
<label>
<input name="dispo" type="radio" class="imputobligatoire" id="dispo_5" value="3 mois">
3 Mois</label>
<br>
</p></td>
</tr>
<tr class="cellule">
<td class="tr2" >Moyens de transport à disposition</td>
<td ><input name="transport" type="text" class="imputobligatoire" id="transport"></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td height="39" colspan="2"><h2 class="tr"><strong>6- Potentiel linguistique</strong></h2></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2" ><table width="90%" border="0" align="center" cellpadding="2" cellspacing="2">
<tr>
<th bgcolor="#999999" scope="col" class="lngtab">Langue</th>
<th bgcolor="#999999" scope="col" class="lngtab">Expression orale</th>
<th bgcolor="#999999" scope="col" class="lngtab">Expression écrite</th>
</tr>
<tr>
<td bgcolor="#EBEBEB" class="lngtabcontent">Anglais</td>
<td bgcolor="#EBEBEB" class="lngtabcontent"><div align="center">
<input name="anglais-oral" type="text" class="imputobligatoire" id="anglais-oral">
</div></td>
<td bgcolor="#EBEBEB" class="lngtabcontent"><div align="center">
<input name="anglais-ecrit" type="text" class="imputobligatoire" id="anglais-ecrit">
</div></td>
</tr>
<tr>
<td bgcolor="#EBEBEB" class="lngtabcontent">Arabe</td>
<td bgcolor="#EBEBEB" class="lngtabcontent"><div align="center">
<input name="arabe-oral" type="text" class="imputobligatoire" id="arabe-oral">
</div></td>
<td bgcolor="#EBEBEB" class="lngtabcontent"><div align="center">
<input name="arabe-ecrit" type="text" class="imputobligatoire" id="arabe-ecrit">
</div></td>
</tr>
<tr>
<td bgcolor="#EBEBEB" class="lngtabcontent">Français</td>
<td bgcolor="#EBEBEB" class="lngtabcontent"><div align="center" class="lngtabcontent">
<input name="francais-oral" type="text" class="imputobligatoire" id="francais-oral">
</div></td>
<td bgcolor="#EBEBEB" class="lngtabcontent"><div align="center">
<input name="francais-ecrit" type="text" class="imputobligatoire" id="francais-ecrit">
</div></td>
</tr>
<tr>
<td bgcolor="#EBEBEB" class="lngtabcontent"><input name="langue-autre-1" type="text" class="imputfacultatif" id="langue-autre-1" value="Autre langue" maxlength="50"></td>
<td bgcolor="#EBEBEB" class="lngtabcontent"><div align="center">
<input name="autre1-oral" type="text" class="imputfacultatif" id="autre1-oral">
</div></td>
<td bgcolor="#EBEBEB" class="lngtabcontent"><div align="center">
<input name="autre1-ecrit" type="text" class="imputfacultatif" id="autre1-ecrit">
</div></td>
</tr>
<tr>
<td bgcolor="#EBEBEB" class="lngtabcontent"><input name="langue-autre-2" type="text" class="imputfacultatif" id="langue-autre-2" value="Autre langue" maxlength="50"></td>
<td bgcolor="#EBEBEB" class="lngtabcontent"><div align="center">
<input name="autre2-oral" type="text" class="imputfacultatif" id="autre2-oral">
</div></td>
<td bgcolor="#EBEBEB" class="lngtabcontent"><div align="center">
<input name="autre2-ecrit" type="text" class="imputfacultatif" id="autre2-ecrit">
</div></td>
</tr>
<tr>
<td bgcolor="#EBEBEB" class="lngtabcontent"><input name="langue-autre-3" type="text" class="imputfacultatif" id="langue-autre-3" value="Autre langue" maxlength="50"></td>
<td bgcolor="#EBEBEB" class="lngtabcontent"><div align="center">
<input name="autre3-oral" type="text" class="imputfacultatif" id="autre3-oral">
</div></td>
<td bgcolor="#EBEBEB" class="lngtabcontent"><div align="center">
<input name="autre3-ecrit" type="text" class="imputfacultatif" id="autre3-ecrit">
</div></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td height="39" colspan="2"><h2 class="tr"><strong>7- Connaissances acquises</strong></h2></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr class="cellule">
<td colspan="2" ><p class="tr2">Détaillez au maximum (informatique, technique, etc...):</p>
<p>
<textarea name="conaissance-detail" cols="100" rows="12" class="imputobligatoire" id="conaissance-detail"></textarea>
</p></td>
</tr>
<tr>
<td height="16" colspan="2"> </td>
</tr>
<tr>
<td height="20" colspan="2" class="tr">Envoi</td>
</tr>
<tr>
<td colspan="2"><p class="cellule"> </p> </td>
</tr>

<tr class="cellule">
<td colspan="2" class="tr2" > <p>
<input name="envoyer" type="submit" class="boutonok" id="envoyer" value="Envoyer">
</p>
<p>
<input name="effacer" type="reset" class="boutoneffacer" id="effacer" value="Effacer">
</p>
</td>
</tr>
<tr>
<td colspan="2" ><div align="right"></div></td>
</tr>
<tr>
<td colspan="2" > </td>
</tr>
</table>
</form>

et voici send.php:

<?php

// Voici la liste infernale que j'ai tapé caractère par caractère :S
// Si ta pas compris le principe, $ définit une nouvelle variable
// le = veut dire =
// et la tu voix la varieble $_POST['...'];
// qui récupère les données du formulaire
// les noms des variables ne doivent pas comprter de majuscules et otre symboles
// tu fais simple
// don pour ajouter un champ, c'est facile avec dreamweaver mais tu précise bien le nom et l'id du champ
// apres tu copie/colle une ligne et tu remplace
// le nom de la variable et le contenu de la variable post par le nom du champ


$nom = $_POST['nom'];
$civilite = $_POST['civilite'];
$prenom = $_POST['prenom'];
$datejour = $_POST['date-jour'];
$datemois = $_POST['date-mois'];
$dateannee = $_POST['date-annee'];
$lieudenaissance = $_POST['lieu-de-naissance'];
$situationnationale = $_POST['situation-nationale'];
$adressenumer = $_POST['adresse-numero'];
$adressetype = $_POST['adresse-type'];
$adresse = $_POST['adresse'];
$adressecodepostal = $_POST['adresse-code-postal'];
$adressecommune = $_POST['adresse-commune'];
$willaya = $_POST['willaya'];
$enfants = $_POST['enfants'];
$nationnalité = $_POST['nationnalité'];
$telfixe = $_POST['tel-fixe'];
$telmobile = $_POST['tel-mobile'];
$mail = $_POST['mail'];
$diplome = $_POST['diplome'];
$precisionsniveauetudes = $_POST['precisions-niveau-etudes'];
$anneeformations = $_POST['annee-formations'];
$certificat = $_POST['certificat'];
$specialite = $_POST['specialite'];
$etablissement = $_POST['etablissement'];
$precisionsformation = $_POST['precisions-formation'];
$xpoui = $_POST['xpoui'];
$xpproprecision = $_POST['XP-pro-precision'];
$xpprode = $_POST['xp-pro-de'];
$xpprodeannee = $_POST['xp-pro-de-annee'];
$xpproa = $_POST['xp-pro-a'];
$xpprodeannee2 = $_POST['xp-pro-de-annee2'];
$xpproposte = $_POST['xp-pro-poste'];
$domaine = $_POST['domaine'];
$affectation1 = $_POST['affectation1'];
$affectation2 = $_POST['affectation2'];
$dispo = $_POST['dispo'];
$transport = $_POST['transport'];
$anglaisecrit = $_POST['anglais-ecrit'];
$anglaisoral = $_POST['anglais-oral'];
$arabeecrit = $_POST['arabe-ecrit'];
$arabeoral = $_POST['arabe-oral'];
$francaisecrit = $_POST['francais-ecrit'];
$francaisoral = $_POST['francais-oral'];
$autre1ecrit = $_POST['autre1-ecrit'];
$autre1oral = $_POST['autre1-oral'];
$autre2ecrit = $_POST['autre2-ecrit'];
$autre2oral = $_POST['autre2-oral'];
$autre3ecrit = $_POST['autre3-ecrit'];
$autre3oral = $_POST['autre3-oral'];
$conaissancedetail = $_POST['conaissance-detail'];
$photo = $_FILE['photo'];


$from .= "MIME-version: 1.0\n";
$rom .= "Content-type: text/html; charset= iso-8859-1\n";

// L'email du destinataire
// Les hotmail sont a eviter
$destinataire = 'dedenast@gmail.com';

//sujet du mail envoié
$sujet = 'Formulaire de recrutement';


// on vérifie si les champs ne sont pas vides avec la fonction if
// tu peux ajouter des champs en faisant copier coler les variables de tout en haut


// création du message, les \n permettent de faire un saut de ligne, a modifier si tu change les champs formulaire

$message = "Candidature \n \n


1 - COORDONNEES \n

Identite: '.$civilite. .$nom. .$prenom.' \n
Date de naissance: '.$datejour.' / '.$datemois.' / '.$dateannee.' \n
Lieu de naissance: '.$lieudenaissance.' \n
Situation vis a vis du national: '.$situationnationale.' \n
Adresse: '.$adressenumer.' , '.$adressetype.' '.$adresse.' \n
Code postal: '.$adressecodepostal.' \n
Commune: '.$adressecommune.' \n
Willaya: '.$willaya.' \n
Enfants: '.$enfants.' \n
Nationnalite: '.$nationnalité.' \n
Tel fixe: '.$telfixe.' \n
Tel mobile: '.$telmobile.' \n
Email: '.$mail.' \n
Photo: '.$photo.' \n \n


2 - ETUDES \n

Dilpome: '.$diplome.' \n
Precisons: '.$precisionsniveauetudes.' \n \n


3 - FORMATIONS \n

Annee: '.$anneeformations.' \n
Cetificat obtennu: '.$certificat.' \n
Specialite: '.$specialite.' \n
Etablissement drequente: '.$etablissement.' \n
Precisions: '.$precisionsformation.' \n \n

4 - EXPERIENCE PROFESSSIONNELLE \n

Oui ou non: '.$xpoui.'\n
Precisions si oui: '.$xpproprecision.'\n
Date: de '.$xpprode.' / '.$xpprodeannee.' a '.$xpproa.' / '.$xpprodeannee2.'\n
Au poste de: '.$xpproposte.' \n \n


5 - DOMAINE DESIRE \n

Domaine: '.$domaine.' \n
Lieu d'affectation desire 1: '.$affectation1.' \n
Lieu d'affectation desire 2: '.$affectation2.' \n
Disponibilite: '.$dispo.' \n
Transport a disposition: '.$transport.' \n \n


6 - NIVEAU LANGUE VIVANTE \n

EN: ecrit: '.$anglaisecrit.' , oral: '.$anglaisoral.' \n
AR: ecrit: '.$arabeecrit.' , oral: '.$arabeoral.' \n
FR: ecrit: '.$francaisecrit.' , oral: '.$francaisoral.' \n
AUTRE1: ecrit: '.$autre1ecrit.' , oral: '.$autre1oral.' \n
AUTRE2: ecrit: '.$autre2ecrit.' , oral: '.$autre2oral.' \n
AUTRE3: ecrit: '.$autre3ecrit.' , oral: '.$autre3oral.' \n \n


7 - DETAILS SUR LES CONAISSANCE INFORMATIQUES , TECHNIQUES, ET AUTRES \n

Conaissances: '.$conaissancedetail.' \n \n \n

Avec respect, '.$civilite.' '.$nom.' '.$prenom.' \n \n \n \n

FIN DU MESSAGE\n" ;

// on envoi le message et sa il ne faut pas y toucher
if( mail($destinataire, $sujet, $message) )

// si tout est ok on affiche que c bon avec la fonction echo
{ echo 'Nous vous remercions, votre demande de condidature a bien ete envoyée. ';

}
// si c pas bon alor on écrit ca et remarque le slash entre le l et '
// c obligatoire sinon rien ne marche
else{ echo 'Un probleme est survenu lors de l\'envoi de votre candidature';

}

?>


PS: g pas piké ce script mais je le fais pour quelqun.

7 réponses

arthezius Messages postés 3538 Date d'inscription jeudi 15 mai 2008 Statut Membre Dernière intervention 11 septembre 2016 475
3 mars 2009 à 11:59
Sur la page de traitement tu peux tester tes variables en faisant pour commencer un simple echo()

Par exemple:
echo 'Destinataire: '.$destinataire.'<br />';
echo 'Sujet: '.$sujet.'<br />';
echo 'Message: '.$message.'<br />';


Si elles sont toutes bien défini elles s'afficheront.
0
jojodivx Messages postés 193 Date d'inscription dimanche 14 décembre 2008 Statut Membre Dernière intervention 9 avril 2009 16
3 mars 2009 à 12:05
Ici : $message = "Candidature \n \n
Et ici : FIN DU MESSAGE\n" ;

Tu devrais mettre des apostrophes à la place de guillemets.


J'ai pas vraiment regardé mais tu devrais faire des boucles quand t'as des suites de chiffres comme ça. Tu gagnerais pas mal de temps ;)
0
J'ai pas trop compris, je les mets ou les echo?
0
arthezius Messages postés 3538 Date d'inscription jeudi 15 mai 2008 Statut Membre Dernière intervention 11 septembre 2016 475
3 mars 2009 à 12:10
Met les à la fin de ta page de traitement de ton mail.
0
jojodivx Messages postés 193 Date d'inscription dimanche 14 décembre 2008 Statut Membre Dernière intervention 9 avril 2009 16
3 mars 2009 à 12:24
Teste ça :

<?php

// Voici la liste infernale que j'ai tapé caractère par caractère :S
// Si ta pas compris le principe, $ définit une nouvelle variable
// le = veut dire =
// et la tu voix la varieble $_POST['...'];
// qui récupère les données du formulaire
// les noms des variables ne doivent pas comprter de majuscules et otre symboles
// tu fais simple
// don pour ajouter un champ, c'est facile avec dreamweaver mais tu précise bien le nom et l'id du champ
// apres tu copie/colle une ligne et tu remplace
// le nom de la variable et le contenu de la variable post par le nom du champ


$nom = $_POST['nom'];
$civilite = $_POST['civilite'];
$prenom = $_POST['prenom'];
$datejour = $_POST['date-jour'];
$datemois = $_POST['date-mois'];
$dateannee = $_POST['date-annee'];
$lieudenaissance = $_POST['lieu-de-naissance'];
$situationnationale = $_POST['situation-nationale'];
$adressenumer = $_POST['adresse-numero'];
$adressetype = $_POST['adresse-type'];
$adresse = $_POST['adresse'];
$adressecodepostal = $_POST['adresse-code-postal'];
$adressecommune = $_POST['adresse-commune'];
$willaya = $_POST['willaya'];
$enfants = $_POST['enfants'];
$nationnalité = $_POST['nationnalité'];
$telfixe = $_POST['tel-fixe'];
$telmobile = $_POST['tel-mobile'];
$mail = $_POST['mail'];
$diplome = $_POST['diplome'];
$precisionsniveauetudes = $_POST['precisions-niveau-etudes'];
$anneeformations = $_POST['annee-formations'];
$certificat = $_POST['certificat'];
$specialite = $_POST['specialite'];
$etablissement = $_POST['etablissement'];
$precisionsformation = $_POST['precisions-formation'];
$xpoui = $_POST['xpoui'];
$xpproprecision = $_POST['XP-pro-precision'];
$xpprode = $_POST['xp-pro-de'];
$xpprodeannee = $_POST['xp-pro-de-annee'];
$xpproa = $_POST['xp-pro-a'];
$xpprodeannee2 = $_POST['xp-pro-de-annee2'];
$xpproposte = $_POST['xp-pro-poste'];
$domaine = $_POST['domaine'];
$affectation1 = $_POST['affectation1'];
$affectation2 = $_POST['affectation2'];
$dispo = $_POST['dispo'];
$transport = $_POST['transport'];
$anglaisecrit = $_POST['anglais-ecrit'];
$anglaisoral = $_POST['anglais-oral'];
$arabeecrit = $_POST['arabe-ecrit'];
$arabeoral = $_POST['arabe-oral'];
$francaisecrit = $_POST['francais-ecrit'];
$francaisoral = $_POST['francais-oral'];
$autre1ecrit = $_POST['autre1-ecrit'];
$autre1oral = $_POST['autre1-oral'];
$autre2ecrit = $_POST['autre2-ecrit'];
$autre2oral = $_POST['autre2-oral'];
$autre3ecrit = $_POST['autre3-ecrit'];
$autre3oral = $_POST['autre3-oral'];
$conaissancedetail = $_POST['conaissance-detail'];
$photo = $_FILE['photo'];


$from .= "MIME-version: 1.0\n";
$rom .= "Content-type: text/html; charset= iso-8859-1<br>";

// L'email du destinataire
// Les hotmail sont a eviter
$destinataire = 'dedenast@gmail.com';

//sujet du mail envoié
$sujet = 'Formulaire de recrutement';


// on vérifie si les champs ne sont pas vides avec la fonction if
// tu peux ajouter des champs en faisant copier coler les variables de tout en haut


// création du message, les <br> permettent de faire un saut de ligne, a modifier si tu change les champs formulaire

$message = 'Candidature <br> <br>


1 - COORDONNEES <br>

Identite: '.$civilite.' '.$nom.' '.$prenom.' <br>
Date de naissance: '.$datejour.' / '.$datemois.' / '.$dateannee.' <br>
Lieu de naissance: '.$lieudenaissance.' <br>
Situation vis a vis du national: '.$situationnationale.' <br>
Adresse: '.$adressenumer.' , '.$adressetype.' '.$adresse.' <br>
Code postal: '.$adressecodepostal.' <br>
Commune: '.$adressecommune.' <br>
Willaya: '.$willaya.' <br>
Enfants: '.$enfants.' <br>
Nationnalite: '.$nationnalité.' <br>
Tel fixe: '.$telfixe.' <br>
Tel mobile: '.$telmobile.' <br>
Email: '.$mail.' <br>
Photo: '.$photo.' <br> <br>


2 - ETUDES <br>

Dilpome: '.$diplome.' <br>
Precisons: '.$precisionsniveauetudes.' <br> <br>


3 - FORMATIONS <br>

Annee: '.$anneeformations.' <br>
Cetificat obtennu: '.$certificat.' <br>
Specialite: '.$specialite.' <br>
Etablissement drequente: '.$etablissement.' <br>
Precisions: '.$precisionsformation.' <br> <br>

4 - EXPERIENCE PROFESSSIONNELLE <br>

Oui ou non: '.$xpoui.'<br>
Precisions si oui: '.$xpproprecision.'<br>
Date: de '.$xpprode.' / '.$xpprodeannee.' a '.$xpproa.' / '.$xpprodeannee2.'<br>
Au poste de: '.$xpproposte.' <br> <br>


5 - DOMAINE DESIRE <br>

Domaine: '.$domaine.' <br>
Lieu d\'affectation desire 1: '.$affectation1.' <br>
Lieu d\'affectation desire 2: '.$affectation2.' <br>
Disponibilite: '.$dispo.' <br>
Transport a disposition: '.$transport.' <br> <br>


6 - NIVEAU LANGUE VIVANTE <br>

EN: ecrit: '.$anglaisecrit.' , oral: '.$anglaisoral.' <br>
AR: ecrit: '.$arabeecrit.' , oral: '.$arabeoral.' <br>
FR: ecrit: '.$francaisecrit.' , oral: '.$francaisoral.' <br>
AUTRE1: ecrit: '.$autre1ecrit.' , oral: '.$autre1oral.' <br>
AUTRE2: ecrit: '.$autre2ecrit.' , oral: '.$autre2oral.' <br>
AUTRE3: ecrit: '.$autre3ecrit.' , oral: '.$autre3oral.' <br> <br>


7 - DETAILS SUR LES CONAISSANCE INFORMATIQUES , TECHNIQUES, ET AUTRES <br>

Conaissances: '.$conaissancedetail.' <br> <br> <br>

Avec respect, '.$civilite.' '.$nom.' '.$prenom.' <br> <br> <br> <br>

FIN DU MESSAGE<br>' ;

// on envoi le message et sa il ne faut pas y toucher
if( mail($destinataire, $sujet, $message) )

// si tout est ok on affiche que c bon avec la fonction echo
{ echo 'Nous vous remercions, votre demande de condidature a bien ete envoyée. ';

}
// si c pas bon alor on écrit ca et remarque le slash entre le l et '
// c obligatoire sinon rien ne marche
else{ echo 'Un probleme est survenu lors de l\'envoi de votre candidature';

}
?>
0
jojodivx Messages postés 193 Date d'inscription dimanche 14 décembre 2008 Statut Membre Dernière intervention 9 avril 2009 16
3 mars 2009 à 12:25
J'ai oublié un petit truc.

Tu marque ça dans form.php :
<form action="send.php" method="get" name="form1" class="style3"> 


C'est plutôt ça :
<form action="send.php" method="post" name="form1" class="style3"> 
0
arthezius Messages postés 3538 Date d'inscription jeudi 15 mai 2008 Statut Membre Dernière intervention 11 septembre 2016 475 > jojodivx Messages postés 193 Date d'inscription dimanche 14 décembre 2008 Statut Membre Dernière intervention 9 avril 2009
3 mars 2009 à 12:28
A ouai j'avais pas vue ça. C'est pour ça que tes champs sont vide alors. Cherche pas plus loin.
0
jojodivx Messages postés 193 Date d'inscription dimanche 14 décembre 2008 Statut Membre Dernière intervention 9 avril 2009 16 > arthezius Messages postés 3538 Date d'inscription jeudi 15 mai 2008 Statut Membre Dernière intervention 11 septembre 2016
3 mars 2009 à 12:32
Raté ^^

Si tu regarde bien, d'un côté il y a "date-jours" et on récupère $_POST['date-jour']
Pareil avec "telephone-fixe" et $_POST['tel-fixe']

Il y en a d'autres :)

Notice: Undefined index: date-jour in C:\wamp\www\send.php on line 18

Notice: Undefined index: tel-fixe in C:\wamp\www\send.php on line 31

Notice: Undefined index: tel-mobile in C:\wamp\www\send.php on line 32

Notice: Undefined index: diplome in C:\wamp\www\send.php on line 34

Notice: Undefined variable: _FILE in C:\wamp\www\send.php on line 66

Notice: Undefined variable: from in C:\wamp\www\send.php on line 69

Notice: Undefined variable: rom in C:\wamp\www\send.php on line 70
0
arthezius Messages postés 3538 Date d'inscription jeudi 15 mai 2008 Statut Membre Dernière intervention 11 septembre 2016 475 > jojodivx Messages postés 193 Date d'inscription dimanche 14 décembre 2008 Statut Membre Dernière intervention 9 avril 2009
3 mars 2009 à 12:35
Ouai mais j'ai envie de dire que ça c'est un autre problème.
En premier lieu si c'est pas en post ça risque pas de marcher même si les variables sont correct.
De toute façon les messages d'erreur seront suffisant pour déceler ces problèmes.
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
Merci pour vos réponses.
Pour method get j'avais changé par post mais ca marche pas...

Comment faire pour les variables alors?
Merci
0
arthezius Messages postés 3538 Date d'inscription jeudi 15 mai 2008 Statut Membre Dernière intervention 11 septembre 2016 475
3 mars 2009 à 22:31
Le $_POST['variable'] doit avoir exactement le même nom que la variable $variable. C'est le nom qui permet de l'identifier et de récupérer sa valeur.
Vérifie donc que chaque $_POST[''] corresponds bien à la variable que tu souhaites.
0
jojodivx Messages postés 193 Date d'inscription dimanche 14 décembre 2008 Statut Membre Dernière intervention 9 avril 2009 16
3 mars 2009 à 22:47
En fait ça correspond au name de ton input.
0