jsnee Posted October 2, 2009 Share Posted October 2, 2009 I made a simple mail form for work and it is not working. I took an existing one that does work and added/changed a few of the form fields. I am a beginner level user of PHP, I know there must be a tiny mistake in it somewhere but I cannot find it. Please help! The PHP file is attached. Thanks in advance! [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/176322-solved-simple-mail-form-not-working-please-help/ Share on other sites More sharing options...
PFMaBiSmAd Posted October 2, 2009 Share Posted October 2, 2009 I took an existing one that does workDoes that mean it worked on the same server where the modified one does not work? it is not working.We know that because you would not be writing a post on a help forum. Just telling us that something does not work is pointlees. What exactly is it doing when you try it? Unless you provide the symptoms to narrow down the dozen possible things that could cause a script to not work on any particular server, no one can directly help you with the problem. What did you see in front of you the leads you to belove it is not working? added/changed a few of the form fields.Please tell us which ones or at least which fields are the originals so the we would have a clue about which areas in the code you touched. Quote Link to comment https://forums.phpfreaks.com/topic/176322-solved-simple-mail-form-not-working-please-help/#findComment-929314 Share on other sites More sharing options...
jsnee Posted October 2, 2009 Author Share Posted October 2, 2009 Sorry for the lack of detail, I'm just frustrated and it is end of day Friday. Thanks for your patience. Yes the original works on the same server where the modified one doesn't. It does not spit out an error of any sort, it simply does nothing. I fill out the form and click "submit" and it just clears the form. No email is sent to my address as it should be. You can view the live form at www.cottageassistedliving.com/billform.php The original is at www.cottageassistedliving.com/mailform.php. The only changes between the two are I added the following fields: Resident's First Name Resident's Last Name Statement Date Amount in Question Monthly Service Fee Cable TV ~CareSteps~ Away Credits Extra Charges Other Is this your first bill? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/176322-solved-simple-mail-form-not-working-please-help/#findComment-929319 Share on other sites More sharing options...
cags Posted October 2, 2009 Share Posted October 2, 2009 Glad I took the time to have a look at your code, learnt a new function, never seen extract before. Anyway, the reason your code isn't working.... The extract function creates a variable of each item in the $_POST array using the key of the item as the name of the variables. In your code you check if $submit. But the name of the submit element on the form is $SubmitForm. Since the if has no else statement attached to it, the mail function is skipped altogether and nothing is ouput. So to solve that problem... <?php // just replace if($submit) // with if($SubmitForm) // near the bottom of your code. ?> I don't know if thats your only problem I didn't look in detail, but it's certainly the first your encountering. Quote Link to comment https://forums.phpfreaks.com/topic/176322-solved-simple-mail-form-not-working-please-help/#findComment-929327 Share on other sites More sharing options...
jsnee Posted October 2, 2009 Author Share Posted October 2, 2009 Thanks so much, I knew it was something little and dumb. I appreciate it Quote Link to comment https://forums.phpfreaks.com/topic/176322-solved-simple-mail-form-not-working-please-help/#findComment-929334 Share on other sites More sharing options...
jsnee Posted October 2, 2009 Author Share Posted October 2, 2009 Okay, so I fixed that and now when I fill it out it spits out my error message that I wrote for when required fields were not complete. Not sure what that is about. I've tried it with ONLY filling out the required fields and again with filling out everything. I'm pretty sure it is unrelated to that and still has something to do with the submit button. Quote Link to comment https://forums.phpfreaks.com/topic/176322-solved-simple-mail-form-not-working-please-help/#findComment-929342 Share on other sites More sharing options...
cags Posted October 2, 2009 Share Posted October 2, 2009 Same problem as before, you are checking for $phone and on your form it's called phone2. Quote Link to comment https://forums.phpfreaks.com/topic/176322-solved-simple-mail-form-not-working-please-help/#findComment-929352 Share on other sites More sharing options...
jsnee Posted October 3, 2009 Author Share Posted October 3, 2009 *Sigh* I need a vacation. It works now, thanks so much. I just needed a pair of fresh, experienced eyes! Quote Link to comment https://forums.phpfreaks.com/topic/176322-solved-simple-mail-form-not-working-please-help/#findComment-929443 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.