Jump to content

[SOLVED] Simple Mail Form Not Working, Please Help


Recommended Posts

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]

I took an existing one that does work
Does 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.

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

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.

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. 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.