Ok I have our contact form fully working, and processing correctly. I have two questions …
-
on the contact form page , I wish to add a checkbox for user to tick to send copy of the email to them aswell.
-
on the process form part I want to redirect to error page if all goes horribly wrong.
Currently on my form submit i have action going to thankyou.php
My form process i have added within the thankyou.php page but could pull it out separately if needed.
…………………………………
My form process is below ( very very simple )
<?php
$youremail = "someonesemail@email.com";
$yourname = $_POST['yourname'];
$email = $_POST['email'];
$location = $_POST['location'];
$textarea = $_POST['textarea'];
$headers = "From: $email";
$content = "Hello there! This is a message from your contact form.\r\n
\r\n
\r\n
Name: $yourname\r\n
\r\n
E-mail: $email\r\n
\r\n
Location: $location\r\n
\r\n
Message: $textarea\r\n\r\n";
$send = mail($youremail, 'Message from your conatct form', $content, $headers);
if($send)
{
echo "ok";
}
Im not brill with php so any help appreciated
I have added one checkbox in form and check the value in server side.
Try this. Hope it will help