> Tous les forumsForum des Webmasters

 aide pour un formulaire en phpSujet résolu
Statut du sujet : RESOLU Imprimer
 herpoel
  Posté le 27/09/2006 @ 09:25  
 Petit astucien

331 Messages
Bonjour à tous, Je souhaite que le message du formulaire de contact qui suit arrive à l'adresse suivante: bernard.herpoel@skynet.be Comment faire? Voici le contenu actuel du bloc note. <html> <!-- Date de création: 28/11/2005 --> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title></title> <meta name="description" content=""> <meta name="keywords" content=""> <style type="text/css"> .menu { border: 0; color: #C8C8C8; font-size: 14; font-family: arial; text-justify: auto } .titre { border: 0; color: #F6F6F6; font-size: 20; font-family: arial; text-justify: auto } .texte { border: 0; color: #C8C8C8; font-size: 12; font-family: arial; font-stretch: semi-condensed; text-justify: auto } .texte1 {border: 0; color: #C8C8C8; font-size: 12; font-family: arial; font-stretch: semi-condensed; text-justify: auto } .titre1 {border: 0; color: #F6F6F6; font-size: 20; font-family: arial; text-justify: auto } </style> <b><font size="5" color="#800080"><b><big></big></b></font></b> </head> <body bgcolor="#2c2b2b" text="#C8C8C8" link="#C8C8C8" vlink="#C8C8C8" alink="#C8C8C8" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0"> <table border="0" cellpadding="0" cellspacing="0" align="center"> <tr> <td width="36" valign="top"> <table border="0" cellpadding="0" cellspacing="0" summary=""> <tr> <td background="../images/1.gif" height="246" width="36"> </td> </tr> <tr> <td bgcolor="#2C2B2B" height="514"></td> </tr> </table> </td> <td width="189" valign="top"> <table border="0" cellpadding="0" cellspacing="0" summary=""> <tr> <td background="../images/2.gif" width="189" height="246"> </td> </tr> <tr> <td bgcolor="#444749" height="514" valign="top"> <table border="0" cellpadding="1" cellspacing="5" class="menu"> <tr> <td background="../images/3.gif" width="189" height="10"></td> </tr> <tr> <td><font color="#FF5A00">::</font> <a href="./index.html" style="text-decoration: none">Home</a> </td> </tr> <tr> <td><font color="#FF5A00">::</font> <a href="./faire.html" style="text-decoration: none">Savoir faire</a></td> </tr> <tr> <td><font color="#FF5A00">::</font> <a href="./fetes.html" style="text-decoration: none">Savoir fêtes</a></td> </tr> <tr> <td><font color="#FF5A00">::</font> <a href="./petite.html" style="text-decoration: none">Autres reparations</a></td> </tr> <tr> <td><font color="#FF5A00">::</font> <a href="./sablage.html" style="text-decoration: none">Sablage & Epoxy</a></td> </tr> <tr> <td><font color="#FF5A00">::</font> <a href="./vente.php?page=vente" style="text-decoration: none">A Vendre</a></td> </tr> <tr> <td><font color="#FF5A00">::</font> <a href="http://www.meguiars.be/" style="text-decoration: none">Entretenir la peinture</a></td> </tr> <tr> <td><font color="#FF5A00">::</font> <a href="./contact.php" style="text-decoration: none">Contact</a></td> </tr> </table> </td> </tr> </table> </td> <td valign="top"> <table border="0" cellpadding="0" cellspacing="0" summary=""> <tr> <td background="../images/4.gif" width="799" height="189"></td> </tr> <tr> <td bgcolor="#2C2B2B" height="533" width="799" valign="top"> <table border="0" summary=""> <tr> <td><table border="0" cellpadding="3" cellspacing="5" align="center"> <tr> <td class="titre1"><font color="#FF5A00">::</font> Formulaire de contact</td> </tr> <tr> <td class="texte1" width="570"><b> <div class="texteformulaire"> <form action="" method="post" enctype="multipart/form-data"> <p>Votre adresse email<span class="asterisque">*</span> : <input type="text" name="email" value="" size=50 class="fondformulaire"> </p> <p>Votre Nom/Pseudo <span class="asterisque">*</span> : <input type="text" name="nom" value="" size=50 class="fondformulaire"> </p> <p class="formcentre">Commentaires :</p> <p class="formcentre"> <textarea name="comment" cols="50" rows="10" class="fondformulaire"></textarea> </p> <p>Fichier joint ( 500Ko maximum) : <input type="hidden" name="MAX_FILE_SIZE" value="500000"/> <input name="upload_localfile" type="file" class="fondformulaire"/> </p> <p class="formcentre"> <input type="reset" name="reset" value="Effacer"> <input type="submit" name="submit" value="Envoyer"> </p> </form> <span class="asterisque">*Champs obligatoires</span> </div> <div align="center"> </div> </b></td> <td valign="top"><img src="../images/cv2.jpg" border="0" width="165" height="239" alt=""></td> </tr> <tr> <td colspan="2"> <div align="center"><img src="../images/belgique.png" alt="Plan" width="370" height="296" vspace="0" border="0"></div></td> </tr> </table></td> </tr> </table> </td> </tr> </table> </td> </tr> </table> </body> </html>
 Afficher le profil de herpoel Envoyer un message privé à herpoel
 
 
Publicité
 herpoel  Posté le 27/09/2006 à 09:28  
Petit astucien

331 Messages
Rebonjour, Voici le texte de la page contact en html! Cela peut servir. <html> <!-- Date de création: 28/11/2005 --> <!-- Mirrored from adla.be/fr/contact.php by HTTrack Website Copier/3.x [XR&CO'2006], Fri, 08 Sep 2006 12:28:01 GMT --> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title></title> <meta name="description" content=""> <meta name="keywords" content=""> <style type="text/css"> .menu { border: 0px none; color: #C8C8C8; font-size: 14; font-family: arial; text-justify: auto } .titre { border: 0px none; color: #F6F6F6; font-size: 20; font-family: arial; text-justify: auto } .texte { border: 0px none; color: #C8C8C8; font-size: 12; font-family: arial; font-stretch: semi-condensed; text-justify: auto } .texte1 {border: 0px none; color: #C8C8C8; font-size: 12; font-family: arial; font-stretch: semi-condensed; text-justify: auto } .titre1 {border: 0px none; color: #F6F6F6; font-size: 20; font-family: arial; text-justify: auto } </style> <b><font size="5" color="#800080"><b><big></big></b></font></b> </head> <body bgcolor="#2c2b2b" text="#C8C8C8" link="#C8C8C8" vlink="#C8C8C8" alink="#C8C8C8" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0"> <table border="0" cellpadding="0" cellspacing="0" align="center"> <tr> <td width="36" valign="top"> <table border="0" cellpadding="0" cellspacing="0" summary=""> <tr> <td background="../images/1.gif" height="246" width="36"> </td> </tr> <tr> <td bgcolor="#2C2B2B" height="514"></td> </tr> </table> </td> <td width="189" valign="top"> <table border="0" cellpadding="0" cellspacing="0" summary=""> <tr> <td background="../images/2.gif" width="189" height="246"> </td> </tr> <tr> <td bgcolor="#444749" height="514" valign="top"> <table border="0" cellpadding="1" cellspacing="5" class="menu"> <tr> <td background="../images/3.gif" width="189" height="10"></td> </tr> <tr> <td><font color="#FF5A00">::</font> <a href="index_2.html" style="text-decoration: none">Home</a> </td> </tr> <tr> <td><font color="#FF5A00">::</font> <a href="faire.html" style="text-decoration: none">Savoir faire</a></td> </tr> <tr> <td><font color="#FF5A00">::</font> <a href="fetes.html" style="text-decoration: none">Savoir fêtes</a></td> </tr> <tr> <td><font color="#FF5A00">::</font> <a href="petite.html" style="text-decoration: none">Autres reparations</a></td> </tr> <tr> <td><font color="#FF5A00">::</font> <a href="sablage.html" style="text-decoration: none">Sablage & Epoxy</a></td> </tr> <tr> <td><font color="#FF5A00">::</font> <a href="vente0a6c.html?page=vente" style="text-decoration: none">A Vendre</a></td> </tr> <tr> <td><font color="#FF5A00">::</font> <a href="../../www.meguiars.be/index.html" style="text-decoration: none">Entretenir la peinture</a></td> </tr> <tr> <td><font color="#FF5A00">::</font> <a href="contact.html" style="text-decoration: none">Contact</a></td> </tr> </table> </td> </tr> </table> </td> <td valign="top"> <table border="0" cellpadding="0" cellspacing="0" summary=""> <tr> <td background="../images/4.gif" width="799" height="189"></td> </tr> <tr> <td bgcolor="#2C2B2B" height="533" width="799" valign="top"> <table border="0" summary=""> <tr> <td><table border="0" cellpadding="3" cellspacing="5" align="center"> <tr> <td class="titre1"><font color="#FF5A00">::</font> Formulaire de contact</td> </tr> <tr> <td class="texte1" width="570"><b> <div class="texteformulaire"> <form action="#" method="post" enctype="multipart/form-data"> <p>Votre adresse email<span class="asterisque">*</span> : <input type="text" name="email" value="" size=50 class="fondformulaire"> </p> <p>Votre Nom/Pseudo <span class="asterisque">*</span> : <input type="text" name="nom" value="" size=50 class="fondformulaire"> </p> <p class="formcentre">Commentaires :</p> <p class="formcentre"> <textarea name="comment" cols="50" rows="10" class="fondformulaire"></textarea> </p> <p>Fichier joint ( 500Ko maximum) : <input type="hidden" name="MAX_FILE_SIZE" value="500000"/> <input name="upload_localfile" type="file" class="fondformulaire" size="20"/> </p> <p class="formcentre"> <input type="reset" name="reset" value="Effacer"> <input type="submit" name="submit" value="Envoyer"> </p> </form> <span class="asterisque">*Champs obligatoires</span> </div> <div align="center"> </div> </b></td> <td valign="top"><img src="../images/cv2.jpg" border="0" width="165" height="239" alt=""></td> </tr> <tr> <td colspan="2"> <div align="center"><img src="../images/belgique.png" alt="Plan" width="370" height="296" vspace="0" border="0"></div></td> </tr> </table></td> </tr> </table> </td> </tr> </table> </td> </tr> </table> </body> <!-- Mirrored from adla.be/fr/contact.php by HTTrack Website Copier/3.x [XR&CO'2006], Fri, 08 Sep 2006 12:28:01 GMT --> </html>
Afficher le profil de herpoel Voir la configuration de herpoelEnvoyer un message privé à herpoel
 Revenir en haut de la page
 ti_ouf  Posté le 27/09/2006 à 12:10  
Astucien


4770 Messages
tu n'as qu'a utiliser la fonction mail() en php tu crées une condition qui utilise la fonction mail() seulement si, le formulaire a été rempli, nottement si tes champs obligatoires ont été bien rempli
Afficher le profil de ti_ouf Voir la configuration de ti_oufEnvoyer un message privé à ti_ouf
  Revenir en haut de la page
 herpoel  Posté le 27/09/2006 à 18:35  
Petit astucien

331 Messages
Merci ti_ouf. Le problème c'est que je ne sais pas programmer en php! Cordialement
Afficher le profil de herpoel Voir la configuration de herpoelEnvoyer un message privé à herpoel
 Revenir en haut de la page
 Malcolm  Posté le 27/09/2006 à 23:51  
  Astucien


7309 Messages
salut, sur un de mes sites "autrefois", j'avais utilisé ce code : [code] <?php if (!isset($_POST['submit'])) { // le bouton submit n'a pas été pressé, on affiche donc le formulaire echo "<form id=\"contact\" method=\"post\" action=\"\">\n"; echo " <div style=\"text-align:center;\">\n"; echo " <table cellpadding=\"0\" cellspacing=\"0\" style=\"border:0px; text-align:left;\">\n"; echo " <tr>\n"; echo " <td style=\"padding-left:50px;\"><p class=\"menu\">Votre nom :<br /><br />Adresse mail :<br /><br />Sujet :<br /></p></td>\n"; echo " <td><input type=\"text\" id=\"nom\" name=\"nom\" /><br /><input type=\"text\" id=\"email\" name=\"email\" /><br /><input type=\"text\" id=\"sujet\" name=\"sujet\" /></td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td colspan=\"2\" style=\"text-align:center;\"><p class=\"menu\"><br />Votre message :</p></td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td colspan=\"2\" style=\"text-align:center;\"><textarea id=\"message\" name=\"message\" cols=\"64\" rows=\"8\"></textarea></td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td colspan=\"2\" style=\"text-align:center;\"><input type=\"submit\" id=\"submit\" name=\"submit\" value=\"Envoyer\" /></td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </div>\n"; echo "</form>\n"; } else { // le bouton submit a été pressé, on traite le formulaire $adresse ="ladressemail@fai.ext"; $expediteur ="Bouuuuuu"; $nomsite ="Site des pros"; $sujet = (isset($_POST['sujet'])) ? trim($_POST['sujet']) : ''; $nom = (isset($_POST['nom'])) ? trim($_POST['nom']) : ''; $email = (isset($_POST['email'])) ? trim($_POST['email']) : ''; $message = (isset($_POST['message'])) ? trim($_POST['message']) : ''; // Vérification des saisies $pattern ="^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}$"; // contrôle des champs if (((!empty($sujet)) && (!empty($nom)) && (!empty($message)) && (!empty($email)) && (eregi ($pattern, $email))) || (!empty($commentaire))) { $message = stripslashes(html_entity_decode(($message))); $destinataires = $adresse.",".$email; $titre = html_entity_decode($sujet); $from="From: $nom <$email>\r\n"; $from.="Reply-To: $nom <$email>\n"; if (mail($adresse.",".$email,$sujet,$message,$from)) { echo "<p class=\"menu\">Votre mail de contact nous est parvenu. <br />Votre demande va être traitée dans les plus brefs délais.</p>\n<p style=\"text-align:center;\"><a href=\"http://www.la-vitrine.com\">Retour à la page d'accueil</a></p>\n"; } else { echo "<p class=\"menu\">Impossible d'envoyer votre mail. Veuillez tenter de nous contacter via forum à la rubrique
VISITEURS
ou par <a href=\"mailto:".$adresse."\">messagerie</a> directement\n<p style=\"text-align:center;\"><a href=\"http://www.la-vitrine.com\">Retour à la page d'accueil</a></p>\n"; } } else { echo "<p class=\"menu\">Erreur : L'un des champs est vide ou l'adresse est mal écrite. Veuillez vérifier svp.<br /><a href=\"javascript:history.go(-1);\">Modifier la saisie</a></p>\n"; } } ?>[/code] il effectue une mise en page à l'aide de tableaux pour les champs de formulaire (discutable sémantiquement parlant) mais il est fonctionnel et te donnera une première approche ...
Afficher le profil de Malcolm Voir la configuration de MalcolmEnvoyer un message privé à Malcolm
  Revenir en haut de la page
 herpoel  Posté le 28/09/2006 à 13:32  
Petit astucien

331 Messages
Merci Malcolm
Afficher le profil de herpoel Voir la configuration de herpoelEnvoyer un message privé à herpoel
 Revenir en haut de la page
Haut de la page 
Inscrivez-vous !
- Posez vos questions

- Résolvez vos problèmes

- Aidez les autres

- Participez et créez vos discussions

- Dialoguez en privé avec d'autres membres

- Suivez vos sujets préférés

- Affichez les signatures des membres

TOUT EST GRATUIT !

Je crée mon compte



Vous avez besoin d'aide ?
Des centaines d'experts sont à votre disposition sur les forums PC Astuces pour vous aider gratuitement, 24h/24, 7j/7.

Les derniers sujets résolus !
 

 > Tous les forumsForum des Webmasters

 
Forum PC Astuces© 1997-2008 WebastucesAller en haut de la page