PHP contact form script

Hi there,
I need your help!! I have been frustrating trying to make it work but everytime I open my website it came up parse error, I have no idea why ? Here is the PHP code…


<?php 
ini_set("sendmail_from", "{EMAIL ADDRESS}"); 
// $subject - set to the Subject line of the email, eg
//$subject = "Feedback Form" ;



$formurl = "{FORMURL}" ;
$errorurl = "{ERRORULR}" ;
$thankyouurl = "{THANKSURL}" ;

$uself = 1;

$headersep = (!isset( $uself ) || ($uself == 0)) ? "
" : "
" ;
$name = $_POST['name'] ;
$email = $_POST['email'] ;
$enquiry = $_POST['enquiry'] ;
$http_referrer = getenv( "HTTP_REFERER" );

if (!isset($_POST['email'])) {
header( "Location: $formurl" );
exit ;
}
if (empty($name) || empty($email) || empty($enquiry)) {
header( "Location: $errorurl" );
exit ;
}
if ( ereg( "[
]", $name ) || ereg( "[
]", $email ) ) {
header( "Location: $errorurl" );
exit ;
}

if (get_magic_quotes_gpc()) {
$enquiry = stripslashes( $enquiry );
}

$messageproper =
"This message was sent from:
" .
"$http_referrer
" .
"
" .

"Name of sender: $name
" .
"Email of sender: $email
" . 
"

".
"$enquiry" .
"


" ;

mail($mailto, $messageproper,
"From: \"$name\" <$email>" . $headersep . "Reply-To: \"$name\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.07" );
header( "Location: $thankyouurl" );
exit ;

?>

Any idea why ? Many thanks

Its been a long while but to me your last part of the script i.e. your mail bit looks suspect.

try something like more like… “From: $name <$email>” ,"$headersep, blah blah

easier to keep the mail bit simple define the content pre and its easier to error check the contents in testing just echo out to screen
mail($recipient, $subject, $message, $headers);

/edit… :confused: where is your $mailto picking its data from there appears no corrisponding $mailto defining an email address

www.tectite.com for one of the best php form-mail scripts there is, and there is no parse error in the code above either, it runs fine - although you would get a ton of spam if you left the code that open.

Due to no parse error, and the links that people try to sneak in for google rankings, I’ve removed all URL’s and emails.

DT.

Died on my laptop with a parse error, my logical guess is the setup to support outgoing email on the server/test environment.

$mailto could be a global variable use to send to yourself defined in the php config certainly not a stand alone.

Tried on my webspace using php4 it ran… but no email received from the script.