Evoke Posted March 27, 2009 Share Posted March 27, 2009 Trying to create a form that'll send the info requested from the form to me, but it's not working and I can't figure it out for love nor money. It's prolly something simple (it is a simple form script thing anyway >.<) <form method="POST" action="request-submit.php"> <table width="100%" border="0"> <tr> <td width="34%" align="left" valign="top" class="style4"><strong>Full Name</strong><br></td> <td width="66%" align="left" valign="top" class="style4"><input type="text" name="name" size="19"></td> </tr> <tr> <td width="34%" align="left" valign="top" class="style5">Login ID </td> <td align="left" valign="top" class="style4"><input name="login" type="text" size="19"></td> </tr> <tr> <td width="34%" align="left" valign="top" class="style5">Email address </td> <td align="left" valign="top" class="style4"><input type="text" name="email" size="19"></td> </tr> <tr> <td width="34%" align="left" valign="top" class="style5">Character on account </td> <td align="left" valign="top" class="style4"><input name="character" type="text" id="character" size="19"></td> </tr> <tr> <td width="34%" align="left" valign="top" class="style5">How did you hear about Free Play? </td> <td align="left" valign="top" class="style4"><p> <select size="1" name="select"> <option>Email</option> <option>HBPortal Forums</option> <option>Friend</option> <option>Other (Please state)</option> </select> ... <input name="Other" type="text" id="Other" size="19"> </p> </td> </tr> <tr> <td width="34%" align="left" valign="top" class="style4"><strong>Message</strong></td> <td align="left" valign="top" class="style4"><textarea rows="9" name="message" cols="45"></textarea></td> </tr> <tr> <td colspan="2" align="left" valign="top" class="style4"><div align="center"> <input type="submit" value="Submit" name="submit2"> </div></td> </tr> </table> <p> </p> </form> It links through fine, but nothing is sent. Here is the submit page. <?php if(isset($_POST['submit'])) { $to = "[email protected],"; $subject = "Request"; $name_field = $_POST['name']; $login_field = $_POST['login']; $email_field = $_POST['email']; $character_field = $_POST['character']; $other_field = $_POST['other']; $message = $_POST['message']; $body = " From: $name_field\n Login: $login_field\n E-Mail: $email_field\n Character: $character_field\n Drop-Down: $dropdown\n Other: $other\n Message: $message\n"; echo "Your request has been sent to $to! "; mail($to, $subject, $body); } else { echo "blarg!"; } ?> The out put that I get from the 2nd page is "blarg!" Link to comment https://forums.phpfreaks.com/topic/151339-solved-problem-getting-error-msg-when-trying-to-submit-form/ Share on other sites More sharing options...
mentalist Posted March 27, 2009 Share Posted March 27, 2009 Its been a while since fiddlin with email, but this is wha i use: function email_send___mail($to, $from, $subject, $msg) { $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers = "From: ".$from."\n"; $headers .= "Reply-To: ".$from."\n"; mail($to, $subject, $msg, $headers); return 0; } but lookin at it, i may need some more slash r's in there... Link to comment https://forums.phpfreaks.com/topic/151339-solved-problem-getting-error-msg-when-trying-to-submit-form/#findComment-794888 Share on other sites More sharing options...
suma237 Posted March 27, 2009 Share Posted March 27, 2009 change submit to submit2(ie the name of the button ). if(isset($_POST['submit2'])) { [code] Link to comment https://forums.phpfreaks.com/topic/151339-solved-problem-getting-error-msg-when-trying-to-submit-form/#findComment-794903 Share on other sites More sharing options...
Evoke Posted March 27, 2009 Author Share Posted March 27, 2009 change submit to submit2(ie the name of the button ). if(isset($_POST['submit2'])) { [code] I dont believe that all I was missing was a character 2 THANK YOU!!! That's that solved. Now that I'm getting emails sent back, I'm not getting all the information requested. From: asdf4 Login: asdfs E-Mail: asdffd Character: asdfd5 Drop-Down: Other: Message: Drop-Down, Other and Message are blank Link to comment https://forums.phpfreaks.com/topic/151339-solved-problem-getting-error-msg-when-trying-to-submit-form/#findComment-794909 Share on other sites More sharing options...
suma237 Posted March 27, 2009 Share Posted March 27, 2009 check the post values $other_field = $_POST['Other']; $dropdown=$_POST['select'];//missing Link to comment https://forums.phpfreaks.com/topic/151339-solved-problem-getting-error-msg-when-trying-to-submit-form/#findComment-794910 Share on other sites More sharing options...
Evoke Posted March 27, 2009 Author Share Posted March 27, 2009 I must be having a blonde moment, I'm trying not to need the replies spoon fed to me.. lol but I don't understand. I changed something (added _field to all of the things) and got message to send a reply. Now I just need the drop down and other to send the reply. What am I missing? ??? <?php if(isset($_POST['submit2'])) { $to = "[email protected]"; $subject = "Helbreath USA: F2P Request opening"; $name_field = $_POST['name']; $login_field = $_POST['login']; $email_field = $_POST['email']; $character_field = $_POST['character']; $other_field = $_POST['other']; $message_field = $_POST['message']; $body = " From: $name_field\n Login: $login_field\n E-Mail: $email_field\n Character: $character_field\n Drop-Down: $dropdown_field\n Other: $other_field\n Message: $message_field\n"; echo "Your request has been sent to $to! "; mail($to, $subject, $body); } else { echo "blarg!"; } ?> Link to comment https://forums.phpfreaks.com/topic/151339-solved-problem-getting-error-msg-when-trying-to-submit-form/#findComment-794914 Share on other sites More sharing options...
suma237 Posted March 27, 2009 Share Posted March 27, 2009 the variable $drop_field is missing...pls check your code Link to comment https://forums.phpfreaks.com/topic/151339-solved-problem-getting-error-msg-when-trying-to-submit-form/#findComment-794918 Share on other sites More sharing options...
Evoke Posted March 27, 2009 Author Share Posted March 27, 2009 the variable $drop_field is missing...pls check your code Thank you for the help, I'm trying not to be newbtastic, but I know I'm failing. I really do appreciate the help. Please don't get mad :'( I've added in the quote (as it's meant to be), I'm now getting what option was in the drop down selection (yay!) I'm not getting the information entered in to the other. First code is from the entry page, second code is from the submit page. <input name="Other" type="text" size="19"> $other_field = $_POST['Other']; Other: $Other_field\n I don't understand why that's not working when <input type="text" name="name" size="19"> $name_field = $_POST['name']; From: $name_field\n does work? Link to comment https://forums.phpfreaks.com/topic/151339-solved-problem-getting-error-msg-when-trying-to-submit-form/#findComment-794920 Share on other sites More sharing options...
Evoke Posted March 27, 2009 Author Share Posted March 27, 2009 nvm got it other_field Other_field Thank you so much for the help! Link to comment https://forums.phpfreaks.com/topic/151339-solved-problem-getting-error-msg-when-trying-to-submit-form/#findComment-794921 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.