SeeeD Posted August 19, 2009 Share Posted August 19, 2009 Hello everybody... I am probably not the first one with such a problem but I still need some help. I have been doing some basic web page development for quite a while now but never really digg into the php stuff. Now that my customer wants a contact pageon his website I need help. I did some research and found some good tutorials online. Still... my code does not wand to work... I get the Error message I set up every single time I try... Please, some one help me... Please don't mind the German langauge, I am German. <form id="form2" method="post" action="mailer.php"> <table width="269"> <tr> <td width="49">Anrede</td> <td width="208"><select name="Anrede" id="Anrede"> <option value="Herr">Herr</option> <option value="Frau">Frau</option> </select></td> </tr> <tr> <td>Vorname</td> <td><input name="Vorname" type="text" id="Vorname" size="35" /></td> </tr> <tr> <td>Name</td> <td><input name="Name" type="text" id="Name" size="35" /></td> </tr> <tr> <td>Straße</td> <td><input name="Straße" type="text" id="Straße" size="35" /></td> </tr> <tr> <td>please</td> <td><input name="please" type="text" id="please" size="35" /></td> </tr> <tr> <td>Stadt</td> <td><input name="Stadt" type="text" id="Stadt" size="35" /></td> </tr> <tr> <td height="24" valign="top">E-Mail</td> <td height="24" valign="top"><label> <input name="E-Mail" type="text" id="E-Mail" size="35" /> </label></td> </tr> <tr> <td height="186" colspan="2" valign="top"><p>Nachricht:</p> <p> <label> <textarea name="Nachricht" cols="41" rows="10" id="Nachricht">Ihre Nachricht hier...</textarea> </label> </p> <p> <label> <input type="submit" name="Send" id="Send" value="Senden" /> </label> </p></td> </tr> </table> </form> ... and here the relating mailer.php <?php if(isset($_POST['submit'])) { $to = "[email protected]"; $subject = "Mi Escuela Kontakt"; $dropdown = $_POST['anrede']; $vorname_field = $_POST['vorname']; $name_field = $_POST['name']; $straße_field = $_POST['straße']; $plz_field = $_POST['please']; $stadt_field = $_POST['stadt']; $email_field = $_POST['email']; $nachricht = $_POST['nachricht']; $body = "Name: $dropdown $vorname_field $name_field\n Adresse: $straße_field $plz_field $stadt_field\n E-Mail: $email_field\n Nachricht:\n $nachricht"; echo "Ihre Nachricht wurde erfolgreich an $to gesendet!"; mail($to, $subject, $body); } else { echo "Error: Keine Daten gesendet! Bitte kehren Sie zurueck auf Kontakt und versuchen Sie es erneut!"; } ?> I did change the [email protected] here... edit: It seems like the forum changes p.l.z. to please automatically... So when it says in the code please there should be p.l.z. (which is the German short for zip code) Please some one help me out Link to comment https://forums.phpfreaks.com/topic/170987-solved-coding-problems/ Share on other sites More sharing options...
Garethp Posted August 19, 2009 Share Posted August 19, 2009 This is the forum for Regex, which is Regular Expressions. You want the PHP Coding Help Forum http://www.phpfreaks.com/forums/index.php/board,1.0.html Link to comment https://forums.phpfreaks.com/topic/170987-solved-coding-problems/#findComment-901828 Share on other sites More sharing options...
Adam Posted August 19, 2009 Share Posted August 19, 2009 Problem lies with your IF: if (isset($_POST['submit'])) { That's checking to see if you've an input set named "submit", except your submit button is named "Send". You can either change the IF or the name of the input to stop viewing your error message. Link to comment https://forums.phpfreaks.com/topic/170987-solved-coding-problems/#findComment-901829 Share on other sites More sharing options...
SeeeD Posted August 19, 2009 Author Share Posted August 19, 2009 ahhh... That helped MrAdam Now I am getting an e-mail... Still the mail I get looks a bit differenet than I expected: I am not getting all values e-mailed, those are missing: $straße_field = $_POST['straße']; $plz_field = $_POST['plz_']; How come? Link to comment https://forums.phpfreaks.com/topic/170987-solved-coding-problems/#findComment-901834 Share on other sites More sharing options...
SeeeD Posted August 19, 2009 Author Share Posted August 19, 2009 Problem solved... Thank you very much Link to comment https://forums.phpfreaks.com/topic/170987-solved-coding-problems/#findComment-901840 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.