[Formulaire] Recherche qlq'un pour un form.
Résolu/Fermé
Utilisateur anonyme
-
10 oct. 2006 à 12:41
Ssylvainsab Messages postés 2884 Date d'inscription samedi 29 juillet 2006 Statut Modérateur Dernière intervention 15 août 2020 - 15 oct. 2006 à 10:24
Ssylvainsab Messages postés 2884 Date d'inscription samedi 29 juillet 2006 Statut Modérateur Dernière intervention 15 août 2020 - 15 oct. 2006 à 10:24
A voir également:
- [Formulaire] Recherche qlq'un pour un form.
- Recherche musique - Guide
- Google recherche par image - Guide
- Recherche automatique des chaînes ne fonctionne pas - Guide
- Recherche adresse - Guide
- Formulaire de réclamation facebook - Guide
4 réponses
Ssylvainsab
Messages postés
2884
Date d'inscription
samedi 29 juillet 2006
Statut
Modérateur
Dernière intervention
15 août 2020
825
10 oct. 2006 à 17:11
10 oct. 2006 à 17:11
Qu'est ce que tu veux créer comme formulaire ?
Pour l'adresse e mail, c'est mieux d'écrire ici, comme ca tout le monde pourra profiter de l'aide qu'on te donnera (le forum est fait pour ca)
Pour l'adresse e mail, c'est mieux d'écrire ici, comme ca tout le monde pourra profiter de l'aide qu'on te donnera (le forum est fait pour ca)
Utilisateur anonyme
11 oct. 2006 à 10:10
11 oct. 2006 à 10:10
Alors le formulaire que je veux créer, est un "bête" formulaire dont les réponses sont envoyé par mail à deux adresses (si possible) sans passer par Outlook. En fait mon formulaire est déja créer mais le résultat n'est pas celui attendu. Il ne s'envoie pas...
Alors je voulais qu'on me réponde par mail comme ça je pouvais envoyer le formulaire pour que la personne qui m'aide puisse changer ce qu'il faut et me le renvoyer.
Merci
W.
Alors je voulais qu'on me réponde par mail comme ça je pouvais envoyer le formulaire pour que la personne qui m'aide puisse changer ce qu'il faut et me le renvoyer.
Merci
W.
Ssylvainsab
Messages postés
2884
Date d'inscription
samedi 29 juillet 2006
Statut
Modérateur
Dernière intervention
15 août 2020
825
11 oct. 2006 à 13:01
11 oct. 2006 à 13:01
Place tout simplement ton code ici, tout le monde pourra t'aider
; )
; )
Ssylvainsab
Messages postés
2884
Date d'inscription
samedi 29 juillet 2006
Statut
Modérateur
Dernière intervention
15 août 2020
825
15 oct. 2006 à 10:24
15 oct. 2006 à 10:24
Ca y est, j'ai terminé le formulaire !
Les fichiers sont a l'adresse sylvain.sab.free.fr/autres/ccmsdz/djwill/
Il y a 3 fichiers :
*l'index (le formulaire)
*Le fichier results.php qui traite les données et les envoie
*Le fichier style.css
Les 3 fichiers sont réunis dans un zip :
sylvain.sab.free.fr/autres/ccmsdz/djwill/index.zip
Je place les codes ici :
Il y a surement des moyens d'optimiser ce fichier, je l'ai fait a la va-vite.
Par exemple, vérifier si les champs obligatoires sont bien remplis avec !empty.
Voila !
Les fichiers sont a l'adresse sylvain.sab.free.fr/autres/ccmsdz/djwill/
Il y a 3 fichiers :
*l'index (le formulaire)
*Le fichier results.php qui traite les données et les envoie
*Le fichier style.css
Les 3 fichiers sont réunis dans un zip :
sylvain.sab.free.fr/autres/ccmsdz/djwill/index.zip
Je place les codes ici :
Fichier index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-strict.dtd"> <html xmlns="www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <title>Booking</title> <link rel="stylesheet" href="style.css" type="text/css" /> </head> <body style="direction: ltr;"> <p>To book DJ Ninjakwan, please fill in this form. Fields with <strong>blue text</strong> are required.</p> <form action="results.php" method="post"> <!--#######################################################################--> <!--EVENT DETAILS--> <!--#######################################################################--> <fieldset> <legend>Event Details</legend> <strong class="obligatoire">Event name : </strong><input name="eventname" /><br /> <strong class="obligatoire">Event date :</strong> <select name="dateday" size="1"> <optgroup label="1-10"> <option>1</option><option>2</option><option>3</option><option>4</option><option>5</option> <option>6</option><option>7</option><option>8</option><option>9</option><option>10</option> </optgroup> <optgroup label="11-20"> <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> </optgroup> <optgroup label="21-31"> <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> </optgroup> </select> <select name="datemonth"> <optgroup label="Winter"> <option>Jan</option><option>Feb</option> </optgroup> <optgroup label="Spring"> <option>Mar</option><option>Apr</option><option>May</option> </optgroup> <optgroup label="Summer"> <option>Jun</option><option>Jul</option><option>Aug</option> </optgroup> <optgroup label="Automn"> <option>Sep</option><option>Oct</option><option>Nov</option> </optgroup><option>Dec</option> </select> <select name="dateyear"> <option>2006</option><option>2007</option><option>2008</option> </select><br /> <span class="strong">Organization : </span><input name="organization" /><br /> <strong class="obligatoire">Contact person : </strong><input name="contactorg" /><br /> <strong class="obligatoire">Address : </strong><input name="addressorg" /><br /> <strong class="obligatoire">Zip code & City : </strong><input name="cityorg" /><br /> <strong class="obligatoire">Country : </strong><input name="countryorg" /><br /> <strong class="obligatoire">Phone number : </strong><input name="phoneorg" /><br /> <strong class="obligatoire">Fax number : </strong><input name="faxorg" /><br /> <strong class="obligatoire">Mobile number : </strong><input name="mobileorg" /><br /> <strong class="obligatoire">E-mail : </strong><input name="mailorg" /><br /> </fieldset> <!--#######################################################################--> <!-- / EVENT DETAILS--> <!--#######################################################################--> <!--#######################################################################--> <!-- LOCATION DETAILS--> <!--#######################################################################--> <fieldset> <legend>Location details</legend> <strong class="obligatoire">Location : </strong><input name="location" /><br /> <strong class="obligatoire">Contact person : </strong><input name="contactloc" /><br /> <strong class="obligatoire">Address : </strong><input name="addressloc" /><br /> <strong class="obligatoire">Zip Code & City : </strong><input name="cityloc" /><br /> <strong class="obligatoire">Country : </strong><input name="countryloc" /><br /> <strong class="obligatoire">Phone number : </strong><input name="phoneloc" /><br /> <span class="strong">Mobile number : </span><input name="mobileloc" /><br /> <strong class="obligatoire">E-mail : </strong><input name="mailloc" /><br /> <span class="strong">Website : </span><input name="websiteloc" /><br /> <strong class="obligatoire">Capacity location : </strong><input name="capacityloc" /><br /> </fieldset> <!--#######################################################################--> <!-- / LOCATION DETAILS--> <!--#######################################################################--> <!--#######################################################################--> <!--PERFORMANCE DETAILS--> <!--#######################################################################--> <fieldset> <legend>Performance details</legend> Time of performance :<br /> from <select name="starthour" size="1"> <option>00</option><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> </select> <select name="startmin" size="1"> <option>00</option><option>10</option><option>20</option><option>30</option><option>40</option><option>50</option> </select> to <select name="endhour" size="1"> <option>00</option><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> </select> <select name="endmin" size="1"> <option>00</option><option>10</option><option>20</option><option>30</option><option>40</option><option>50</option> </select><br /><br /> <strong class="obligatoire">Artist before : </strong><input name="before" /><br /> <strong class="obligatoire">Artist after : </strong><input name="after" /><br /> <strong class="obligatoire">Asked style :</strong> <select name="style"> <option>Hardstyle</option> <option>Trance</option> </select><br /> <strong class="obligatoire">Ticket price : </strong><input name="price" /><br /> <strong class="obligatoire">Campaign : </strong><input name="campaign" /><br /> <span class="strong">Extra : </span><textarea name="extra" cols="30" rows="3"></textarea><br /> <input name="Submit" value="Submit" type="submit" /><br /> </fieldset> <!-- / PERFORMANCE DETAILS--> </form> </body> </html>
Fichier results.php
Il y a surement des moyens d'optimiser ce fichier, je l'ai fait a la va-vite.
Par exemple, vérifier si les champs obligatoires sont bien remplis avec !empty.
<?php if(isset($_GET['source'])) { highlight_file(__FILE__); exit; }?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="www.w3.org/1999/xhtml" lang="fr"> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" /> <title>Message envoyé !</title> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <?php /*on passe aux htmlentities toutes les variables postées*/ //EVENT DETAILS $event_name=htmlentities($_POST['eventname']); //date $event_dateday=htmlentities($_POST['dateday']); $event_datemonth=htmlentities($_POST['datemonth']); $event_dateyear=htmlentities($_POST['dateyear']); //organization $organization=htmlentities($_POST['organization']); $contact_person_organization=htmlentities($_POST['contactorg']); $adress_organization=htmlentities($_POST['adressorg']); $zipcode_and_city_organization=htmlentities($_POST['cityorg']); $country_organization=htmlentities($_POST['countryorg']); $phone_number_organization=htmlentities($_POST['phoneorg']); $fax_number_organization=htmlentities($_POST['faxorg']); $mobile_number_organization=htmlentities($_POST['mobileorg']); $mail_organization=htmlentities($_POST['mailorg']); //LOCATION DETAILS $location=htmlentities($_POST['location']); $contact_person_location=htmlentities($_POST['contactloc']); $adress_location=htmlentities($_POST['adressloc']); $zipcode_and_city_location=htmlentities($_POST['cityloc']); $country_location=htmlentities($_POST['countryloc']); $phone_number_location=htmlentities($_POST['phoneloc']); $mobile_number_location=htmlentities($_POST['mobileloc']); $email_location=htmlentities($_POST['mailloc']); $site_location=htmlentities($_POST['websiteloc']); $capacity_location=htmlentities($_POST['capacityloc']); //PERFORMANCE DETAILS $start_hour_performance=htmlentities($_POST['starthour']); $start_minut_performance=htmlentities($_POST['startmin']); $end_hour_performance=htmlentities($_POST['endhour']); $end_minut_performance=htmlentities($_POST['endmin']); $artist_before_performance=htmlentities($_POST['before']); $artist_after_performance=htmlentities($_POST['after']); $asked_style_performance=htmlentities($_POST['style']); $ticket_price_performance=htmlentities($_POST['price']); $campaign_performance=htmlentities($_POST['campaign']); $extra_performance = htmlentities($_POST['extra']); /*on concatène les chaines e plusieurs blocs d'informations*/ $event_details = "EVENT DETAILS Event name : $eventname\n \nEvent date : $event_dateday $event_datemonth $event_dateyear\n \n\nOrganization : $organization\n Contact person : $contact_person_organization\n Address : $adress_organization\n Zip code and city : $zipcode_and_city_organization\n Country : $country_organization\n Phone number : $phone_number_organization\n Fax Number : $fax_number_organization\n Mobile number : $mobile_number_organization\n E-mail : $mail_organization\n"; $location_details ="\n\nLOCATION DETAILS Location : $location\n Contact Person : $contact_person_location\n Adress : $adress_location\n Zip Code and City : $zipcode_and_city_location\n Country : $country_location\n Phone number : $phone_number_location\n Mobile number : $mobile_number_location\n E-mail : $email_location\n Website : $site_location\n Capacity Location : $capacity_location\n"; $performance_details="\n\nPERFORMANCE DETAILS\n\n Start : $start_hour_performance $start_minut_performance\n End : $end_hour_performance $end_minut_performance\n Artist Before : $artist_before_performance\n Artist after : $artist_after_performance\n Asked Style : $asked_style_performance\n Ticket price : $ticket_price_performance\n Campaign : $campaign_performance\n Others :\n $extra_performance"; //On met les 3 blocs en 1 et on fait un dernier "nettoyage" $message ="$eventdetails\n\n\n$location_details\n\n\n$performance_details"; $message=nl2br(stripslashes(htmlentities($message))); //les variables destinataire, objet $objet='Booking'; $destinataire = 'will_gielen@yahoo.fr,pit_gielen@yahoo.fr'; $from="From: $contact_person_organization<$mail_organization>\r\nReply-To: $contact_person_organization<$mail_organization>\n"; mail($destinataire,$objet,$message,$from); ?> <h1>Message envoyé !</h1> <p>Votre message a bien été envoyé.<br /> <a href="main.htm">Retour a l'accueil</a></p> <p>Apercu du message :<br /> <?php echo $message; ?> </body> </html>
Style.css
body {background-color: black; color: white;} form{border: 2px solid red;padding: 0pt 1em 1em;margin-right: 40%;} fieldset {border: 2px solid gray;margin: 1em;padding: 2em;} fieldset legend {font-size: 1.5em;font-weight: bold;color: yellow;} form textarea,form input, form select {margin:2px;} strong.obligatoire {color: #66ffff;} span.strong, strong.obligatoire{display:block;width:150px;float:left;}
Voila !