Trying to write a contact form script only my following page isnt processing…
<?php
$rpname = $_POST['name'];
$rpnumber = $_POST['phone'];
echo $rpname;
echo $rpnumber;
$rpname = $_POST['name'];
$rpnumber = $_POST['phone'];
$to = "liam@.co.uk"; // CHANGE THIS TO EMAIL YOU WANT
$subject = "Phonecall Request"
//begin of HTML message
$message = "
Phone call request -
From : $rpname,
Number: $rpnumber
";
$headers = "MIME-Version: 1.0rn";
$headers .= "Content-type: text/html; charset=iso-8859-1rn";
$headers .= "From: Website Enquiry";
if (isset($rpname))
{
// now lets send the email.
mail($to, $subject, $message, $headers);
$page='index.html';
header('Location:'.$page);
header('Location: ' . $_SERVER['HTTP_REFERER'] . '?e=Message Sent!');
} ?>
Ive tried to echo the variables at the top but im getting a blank page with no source…
You need a semicolon (;) after
$subject = "Phonecall Request".You would have caught this error yourself if your configuration had error reporting enabled. Do this is in your
php.inifile. This will most likely be located in/etc/php5/cgi/. Add the following lines:If you don’t have access to this on your server, you can add it on a per-document basis, by including the following line at the beginning of each PHP document: