I recently went through Chris' form tutorial. I've got it to validate and I've got the style that I want. However, I can't seem to get the PHP to give the form functionality.
// redirect to success page // CHANGE THE URL BELOW TO YOUR \"THANK YOU\" PAGE if ($success){ print \"<meta http-equiv=\"refresh\" content=\"0;URL=contactthanks.html\">\"; } else{ print \"<meta http-equiv=\"refresh\" content=\"0;URL=error.html\">\"; } ?>
When I try the form, I get this error: "Parse error: syntax error, unexpected T_STRING in /home/content/f/a/u/faulkventures/html/contactengine.php on line 35"
anyway, you never \ your " this will work, if your file is there and its not in another directory: print "<meta http-equiv=\"refresh\" content=\"0;URL=contactthanks.html">";
in your print double quotes you had other double quotes, so this confused the php, you have to escape some: hence the =\" You will also have to fix line 38 for it all to work, but you can follow what I changed.
as an extra why not add another email part thanking people for using your contact form??
her is my full script including sending robots to google, populating the email, and sending the email to me and a confirmation email to the form filler, with a redirect if successful or not:
// redirect to success page if ($success){ //sending mail to the person who filled in the form if they filled in the email mail($email, $Subject, \"$name\n\nThank you for contacting honeycomb-web.\nWe will contact you as soon as possible regarding your query.\", \"From: <$EmailTo>\", \"-froot@honeycomb-web.co.uk\"); print \"<meta http-equiv=\\"refresh\\" content=\\"0;URL=http://www.honeycomb-web.co.uk/thanks.html\\">\"; } else{ print \"<meta http-equiv=\\"refresh\\" content=\\"0;URL=http://www.honeycomb-web.co.uk/error.html\\">\"; } ?>
EDIT: try sending your contact form with no details, your fields required are not at the correct places, something you might want to look into
//send copy to me as well, this is the second email, you can add as many as you like here with the mail function $success = mail(\"ikthius@gmail.com\", $Subject, $Body, \"From: <$email>\", \"-froot@honeycomb-web.co.uk\");
//sending mail to the person who filled in the form if they filled in the email mail($email, $Subject, \"$name\n\nThank you for contacting honeycomb-web.\nWe will contact you as soon as possible regarding your query.\", \"From: <$EmailTo>\", \"-froot@honeycomb-web.co.uk\"); print \"<meta http-equiv=\\"refresh\\" content=\\"0;URL=http://www.honeycomb-web.co.uk/thanks.html\\">\"; }
I recently went through Chris' form tutorial. I've got it to validate and I've got the style that I want. However, I can't seem to get the PHP to give the form functionality.
Here's the PHP:
When I try the form, I get this error: "Parse error: syntax error, unexpected T_STRING in /home/content/f/a/u/faulkventures/html/contactengine.php on line 35"
Line 35 is this part of the PHP:
The file name is correct and is in the correct directory.
Here is the FORM HTML:
I am new to web design and this is my first attempt at a contact form. Any help would be greatly appriciated!
Thanks!
PS. Here is the site I'm working on: http://faulknerventures.com/contact
anyway, you never \ your "
this will work, if your file is there and its not in another directory:
print "<meta http-equiv=\"refresh\" content=\"0;URL=contactthanks.html">";
in your print double quotes you had other double quotes, so this confused the php, you have to escape some:
hence the =\"
You will also have to fix line 38 for it all to work, but you can follow what I changed.
as an extra why not add another email part thanking people for using your contact form??
her is my full script including sending robots to google, populating the email, and sending the email to me and a confirmation email to the form filler, with a redirect if successful or not:
EDIT: try sending your contact form with no details, your fields required are not at the correct places, something you might want to look into
Awesome!! Thank you very much. This has made my day.
I know about the field errors; thanks for catching that :D
PHP is quite impressive.
If I wanted to have the form e-mail 2 different address could I just add the second address like this:
??
If not, any suggestions?
I thinks so, never tried it, but I just add another mail function, with a different address.
in the if($success)
I have this on a clients page:
your welcome, hope it works the way your wanting