Contact.php

lilea -  
Yaninho Messages postés 530 Statut Membre -
Bonjour, j'ai cree un formulaire de contact: Mais pour le contact php je bloque je n'arrive pas avec les bouttons radio.
Quelqu'un pourrais m'aider svp

<form method="post" action="contact.php">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="16">
<tr> 
<td></td>
</tr>
</table>

<table border="0" cellspacing="0" cellpadding="0">
<tr> 
<td width="22" height="28"></td>
<td width="150"><font color="#222222"><b><font color="#777777">Nom:</font></b></font></td>
<td> 
<input type="text" name="nom" style="border: 1px solid #d7d7d7; width:185px;"/>
</td>
</tr>
</table>

<table border="0" cellspacing="0" cellpadding="0">
<tr> 
<td width="22" height="28"></td>
 <td width="150"><font color="#222222"><b><font color="#777777">Prénom:</font></b></font></td>
<td> 
<input type="text" name="prenom" style="border: 1px solid #d7d7d7; width:185px;"/>
</td>
</tr>
</table>

<table border="0" cellspacing="0" cellpadding="0">
<tr> 
<td width="22" height="28"></td>
<td width="150"><font color="#222222"><b><font color="#777777">E-mail:</font></b></font></td>
<td> 
<input type="text" name="e-mail" style="border: 1px solid #d7d7d7; width:185px;"/>
</td>
</tr>
</table>

<table border="0" cellspacing="0" cellpadding="0">
<tr> 
<td width="22" height="28"></td>
<td width="150"><font color="#222222"><b><font color="#777777">Sexe:</font></b></font></td>
<td> 
Homme: <INPUT type=radio name="sexe" value="M">&nbsp;&nbsp;Femme: <INPUT type=radio name="sexe" value="F">
</td>
</tr>
</table>
<br>                                                                   
<table border="0" cellspacing="0" cellpadding="0">
<tr> 
<td width="22" height="28"></td>
<td width="150" valign="top"><font color="#222222"><b><font color="#777777">Votre message:</font></b></font></td>
<td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tr> 
<td width="22" height="28"></td>
<td width="150" valign="top">
<textarea id="message" name="message" rows="7" class=input style="border: 1px solid #d7d7d7; width:335px;"></textarea></td>
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="20">
<tr> 
<td></td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>

<input type="submit" name="submit" value="Envoyer" class="submit" /></td>
</form>

6 réponses

bissdebrazza Messages postés 2886 Statut Contributeur 712
 
salut!
sois un peu plus clair stp!le bouton radio a fait quoi?
0
Yaninho Messages postés 530 Statut Membre 63
 
Que veux tu faire avec ce formulaire ?
0
lilea
 
<td width="150"><font color="#222222"><b><font color="#777777">Sexe:</font></b></font></td>
<td>
Homme: <INPUT type=radio name="sexe" value="M">  Femme: <INPUT type=radio name="sexe" value="F">

Dsl, je voulais dire ici que dois-je ecrire en php afin que cela m'envoi aussi sur mon mail?
0
Yaninho Messages postés 530 Statut Membre 63
 
Tu dois avoir un truc du genre :

<?php $sexe=$_POST['sexe']; ?>


Et après tu utilise ta variable $sexe comme tu veux dans ton envoi de mail.
Ce qu'il y aura dans ton mail, c'est la valeur de l'attribut "value".

Voila
0

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

Posez votre question
lilea
 
Merci ca marche!!!
Mais c'est possible d'afficher un message d'erreur losque un champ n'est pas bien remplie?

Merci a toi!
0
Yaninho Messages postés 530 Statut Membre 63
 
oui bien sur. En fait tu test tes variables.


<?php
   
    if(isset($_POST['sexe']))  //Si la variable existe
   {
      $sexe = $_POST['sexe'];  //on l'assigne
   }
   else   //sinon
   {
       echo "Veuillez remplir le champ";  //message d'erreur
   }

?>
0