Form submission and mailing

Hallo there!
I am a complete PHP noob so please go easy on me :slight_smile:

What I need to do is the following: an invitation mail goes out and people click on a link to RSVP and is taken to this page:
http://www.menusolutions.co.za/webpage-save-the-date.html

Here people tick a radio box to say either “Yes” or “No” and they fill in their name(s). If they say “Yes”, a mail should be sent with the Yes answer plus the names they entered and they should redirect to this page to thank them for their submission:
http://www.menusolutions.co.za/anch_yes.html

Should they tick “No”, a mail should be sent that contains the “No” answer plus the name the user has entered and be redirected to this page to say sorry that they will not be attending:
http://www.menusolutions.co.za/anch_no.html

I also have an error page if they have not selected anything: http://www.menusolutions.co.za/anch_error.html

What I need help with, please, is the PHP that compiles the mail. I was advised to have 3 PHP files - the first “deciding-mailer.php” simply test for Yes or No and then directs to another php file for Yes and yet another for No - here is where I fall down - when I select Yes or No and enter the names, it goes through to the correct response page, but I receive no email. I am also a bit worried about validation, of which there is none at the moment, so even if I enter no names, it still goes to the response page, so I would need to validate for no entries and then redirect to the error page.

I cannot seem to attach any files, sorry!

Could you please be so kind as to let me know where I have gone wrong / what I am missing? Please treat me as a complete idiot :stuck_out_tongue:

You can have one page to complete both tasks.
if(yes) compile email subject and body if(no) compile different email subject and body.
at the end send the email.

With the validating you can validate the forms post data with if(strlen($_POST[‘name’] > 0)
Handling can be done by sending to anch_error.php?code=1 or 2 or 3 then based on the code with $_GET[‘code’] output a message
Hard to say why the email isnt being sent without seeing any code.
Just copy and paste it within [php ] [/php ] forum tags (remove any sensitive information)

Sponsor our Newsletter | Privacy Policy | Terms of Service