Code:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sending...</title>
</head>
<?php
$to = "[email protected]";
$subject = "Contact recieved from Jonnyisms";
$name = $_REQUEST['name'] ;
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'];
$headers = "From: $email";
$sent = mail($to, $subject, $message, $headers) ;
if($sent)
{print "Thank you $name, Your mail was sent successfully."; }
else
{print "We encountered an error sending your mail, please click back on your browser."; }
?>
<body>
</body>
</html>
I have the above as a php page which processes the contact form on my website, my questions are:
1. how can i get this page to automatically forward the user back onto a page in my website.
2. how can i get the email to display the name of the sender as well, at the moment I have it collecting the user's name but it is only used in a line to thank them for sending.