Xenatos | Bonjour tout le monde.
Je suis un debutant en programmation, et je n'arrive pas a finir mon formulaire en html.
Ce que je veux c'est recevoir les infos du formulaire directement ds ma boite email..
Mais comme je ne suis pas pro de php je suis un peu perdu..
Y a t'il quelqu'un pour modifier mon code php pour que je recoive correctement les infos directement ds ma boite e mail?
info : c'est un site perso free.fr
mon code HTML
et mon code php :
Code :
- <?php /* Date de création: 15/07/2007 */ ?>
- <html>
- <body>
- <?php
- //Dabord il faut vérifier que l'utilisateur a tout rempli pour qu'il ne vous parvienne pas d'email vide
- if (isset($_POST['nom'],
- $_POST['prenom'],
- $adresse=$_POST['adresse'],
- $code=$_POST['code'],
- $ville=$_POST['ville'],
- $mail=$_POST['mail'],
- $telephone=$_POST['telephone'],
- $entreparticulier=$_POST['entreparticulier'],
- $statutplus=$_POST['statutplus'],
- $autreentreparticulier=$_POST['autreentreparticulier'],
- $devisdoc=$_POST['devisdoc'],
- $travaux=$_POST['travaux'],
- $prestation=$_POST['prestation'],
- $locaux=$_POST['locaux'],
- $autrelocaux=$_POST['autrelocaux'],
- $etatlocaux=$_POST['etatlocaux'],
- $autreetatlocaux=$_POST['autreetatlocaux'],
- $piece=$_POST['piece'],
- $departementravaux=$_POST['departementravaux'],
- $villetravaux=$_POST['villetravaux'],
- $delai=$_POST['delai'])
- AND !empty($_POST['nom'],
- $_POST['prenom'],
- $adresse=$_POST['adresse'],
- $code=$_POST['code'],
- $ville=$_POST['ville'],
- $mail=$_POST['mail'],
- $telephone=$_POST['telephone'],
- $entreparticulier=$_POST['entreparticulier'],
- $statutplus=$_POST['statutplus'],
- $autreentreparticulier=$_POST['autreentreparticulier'],
- $devisdoc=$_POST['devisdoc'],
- $travaux=$_POST['travaux'],
- $prestation=$_POST['prestation'],
- $locaux=$_POST['locaux'],
- $autrelocaux=$_POST['autrelocaux'],
- $etatlocaux=$_POST['etatlocaux'],
- $autreetatlocaux=$_POST['autreetatlocaux'],
- $piece=$_POST['piece'],
- $departementravaux=$_POST['departementravaux'],
- $villetravaux=$_POST['villetravaux'],
- $delai=$_POST['delai'],))
- {
- $nom=$_POST['nom'];
- $prenom=$_POST['prenom'];
- $adresse=$_POST['adresse'];
- $code=$_POST['code'];
- $ville=$_POST['ville'];
- $mail=$_POST['mail'];
- $telephone=$_POST['telephone'];
- $entreparticulier=$_POST['entreparticulier'];
- $statutplus=$_POST['statutplus'];
- $autreentreparticulier=$_POST['autreentreparticulier'];
- $devisdoc=$_POST['devisdoc'];
- $travaux=$_POST['travaux'];
- $prestation=$_POST['prestation'];
- $locaux=$_POST['locaux'];
- $autrelocaux=$_POST['autrelocaux'];
- $etatlocaux=$_POST['etatlocaux'];
- $autreetatlocaux=$_POST['autreetatlocaux'];
- $piece=$_POST['piece'];
- $departementravaux=$_POST['departementravaux'];
- $villetravaux=$_POST['villetravaux'];
- $delai=$_POST['delai'];
- /*
- :
- :
- Et tu continue à mettre tes variables de cette manière
- */
- $MAIL='Nom : '.$nom.'<br/>Prénom : '.$prenom.'<br/>Adresse : '.$adresse.'<br/>Code Postale : '.$code;
- $mon_email='fatihbalboa@hotmail.com'; //Ici tu met ton email
- $sujet='Demande devis gratuit'; //Ici tu met le sujet du message qui va te parvenir
- if(mail($mon_email, $sujet, $MAIL)
- {
- echo "<p>Envoi de l'E-mail réussi</p>";
- }
- else
- {
- echo "<p>Echec lors de l'envoi de l'E-mail</p>";
- }
- }
- else
- {
- echo '<p>Vous avez oublié de remplir l\'un des formulaire, veuillez le refaire</p>'
- }
- ?>
|
|