I've got this simple form on a WP page, and all it does basically is Email me the content of the form and redirect the visitor to a thank you page after. This is the PHP script that processes the form:
Code: Select all
<?php
$to = "me@mywebsite.com";
$subject = "Email From My Website";
$email = $_REQUEST['email'] ;
$firstname = $_REQUEST['firstname'] ;
$lastname = $_REQUEST['lastname'] ;
$phone = $_REQUEST['phone'] ;
$sydney = $_REQUEST['radio1'] ; // This is a radio button
$kuala = $_REQUEST['radio2'] ; // This is a radio button
$jakarta = $_REQUEST['radio3'] ; // This is a radio button
$surabaya = $_REQUEST['radio4'] ; // This is a radio button
$hongkong = $_REQUEST['radio5'] ; // This is a radio button
$singapore = $_REQUEST['radio6'] ; // This is a radio button
$guestfirstname = $_REQUEST['guestfirstname'] ;
$guestlastname = $_REQUEST['guestlastname'] ;
$guestemail = $_REQUEST['guestemail'] ;
$guestphone = $_REQUEST['guestphone'] ;
$message = "CUSTOM MESSAGE WITH THE ABOVE $variables GOES HERE" ;
$headers = "From: $email";
$sent = mail($to, $subject, $message, $headers) ;
if($sent)
{header( "Location: http://www.site.com/thankyou" );}
else
{print "We encountered an error sending your mail"; }
?>Thanks in advance for any help!