undefined variable query
Posted: Wed Mar 29, 2006 3:13 am
Hi, I keep getting the error ‘undefined variable’ which is referring to $to from this bit of code below when I try to submit my page.
Can anyone tell me what is wrong as I have used this on other pages on other sites and don’t get this error?
Any help would be great
Thanks
Brian
Can anyone tell me what is wrong as I have used this on other pages on other sites and don’t get this error?
Any help would be great
Thanks
Brian
Code: Select all
$from = 'Snazzy Dogz' . "\r\n";
$subject = 'Message from your Web Site ' . "\r\n";
$headers = "To: Snazzy Dogz <info@blah.com>, Admin<info@blah.com> \r\n";
$headers .= "from: $from\n";
$message = $_POST['Name']. ' is requesting some information from you.' . "\r\n";
$message .= ' ' . "\r\n";
$message .= 'The Subject is: ' .$_POST['Subject']. "\r\n";
$message .= ' ' . "\r\n";
$message .= 'They wrote: ' ."$messagedetails". "\r\n";
$message .= '' . "\r\n";
$message .= 'You can email them back at: ' .$_POST['Email']. "\r\n";
$message .= ' ' . "\r\n";
$message .= ' ' . "\r\n";
$message .= ' ' . "\r\n";
$message .= 'This email has been automatically generated. Please do not reply to it.' . "\r\n";
mail($to,$subject,$message,$headers);
header('Location: contact_act.php');
exit();