Hello,
I get the following error when i submit the form on my website to email.php:
Parse error: parse error in /home/httpd/vhosts/ecstatix.com/httpdocs/email.php on line 84
<?php
Below is the code for email.php
Thank you for your time,
Jason D
NL-PHPMail v1.5
First released December 11, 2002
This version released October 6, 2003
NL-PHPMail v1.5 is linkware and can be used or modified as long as this note remains intact
and unaltered, and there is a link up back to <a href="http://codegrrl.com/" target="_blank">http://codegrrl.com/</a> so people know where you got this script. You are forbidden to sell or distribute the code of NL-PHPMail v1.5, in whole
or part, without the written consent of Sasha.
By using NL-PHPMail v1.5 you agree to indemnify Sasha from any liability.
// -----------------------
//VARIABLES NEEDED FOR THE SCRIPT TO WORK, PLEASE CHANGE THESE AS SPECIFIED
// -----------------------
//Your email address (where the form will be sent):
$recipient = 'jd60131@appstate.edu';
//The subject of the email:
$subject = 'Ecstatix Contact Form';
//Change this to the URL to your HTML form.
$form_url = 'http://www.ecstatix.com/contact.html';
//If you're using Headers and Footers with PHP, please fill in the path to them below. This can be a relative path (like, header.inc if it's in the same directory), or an absolute path. If you're NOT using headers, please leave this empty.
$header ='';
$footer ='';
//Below is the content of the actual email sent to you. If you have different or more form fields than specified here, copy and paste the below line (without the // in front of it) into the coding bit below. Beneath the Comments line would be a good place for it:
// $msg .= "Field Description: $POST[field_name]\n";
// Change the description and field name to match the field in your form. The $POST[field_name] variable is what takes the contents of the form fields, so change "field_name" to the name of your form field. The . in front of the = sign merely means that line will be added to the variable, along with all previous lines, instead of overwriting it, so don't take it out! Use \t to insert a tab, and \n to insert a new line.
$tmpname = $POST['name'];
$tmpfrom = $POST['from'];
$tmpphone = $POST['Phone Number'];
$tmpbs = $POST['business'];
$tmpcom = $_POST['Comment Box'];
$msg = "---------------\n";
$msg .= "$subject\n";
$msg .= "---------------\n\n";
$msg .= "Name: $tmpname\n";
$msg .= "E-Mail: $tmpfrom\n";
$msg .= "Phone Number: $tmpphone\n";
$msg .= "Organization name: $tmpbs\n";
$msg .= "Comments: $tmpcom\n";
$msg .= "Sender IP Address: $REMOTE_ADDR\n";
// Change the names below to the 3 required fields in your form. If these fields are not filled out, the script will not send an email and display an error message instead, asking the visitor to fill out the form again.
$req1 ="$name";
$req2 ="$from";
$req3 ="$Comment Box";
//The below error message will be displayed if not all required fields are filled in. Feel free to use normal HTML in this.
$error_required = '<p>It appears you forgot to enter either your email address, your name or your comments. Please press the BACK button in your browser and try again.</p>';
//The below error message will be displayed if the visitor submitted an invalid email address. Feel free to use normal HTML in this.
$error_email = '<p>Oops, it appears that the email address you filled in is not a valid one. Please press the back button on your browser and try again. Please check carefully that you filled in all information in the right fields!</p>';
//The below success message will be displayed when the form is sent. Feel free to use normal HTML in this.
$success_message = '<p>Your information has been sent to Ecstatix Web Design. We will email you back as soon as possible. </p>';
// -----------------------
//DO NOT EDIT ANYTHING BELOW UNLESS YOU KNOW WHAT YOU'RE DOING!!
// -----------------------
if ($header ==""){
$use_headers ='0';
$header = '<html><head><title>Feedback Form</title></head><body>';
} else {$use_headers ='1';}
if ($footer ==""){
$use_footers ='0';
$footer = '<div align="center"><a href="http://codegrrl.com/" target="_blank"><img src="phpmail.gif" width="80" height="15" alt="Powered by NL-PHPMail" border="0" /></a></div></body></html>';
} else {$use_footers ='1';}
function is_valid_email ($address) {
return (preg_match(
'/[-!#$%&'*+./0-9=?A-Z_{|}~]+'.
'@'.
'([-0-9A-Z]+.)+' .
'([0-9A-Z]){2,4}$/i',
trim($address)));
}
function is_valid_email_eregi ($address) {
return (eregi(
'^[-!#$%&'*+\./0-9=?A-Z^_{|}~]+'.
'@'.
'([-0-9A-Z]+.)+' .
'([0-9A-Z]){2,4}$',
trim($address)));
}
if (!isset($req1) || !isset($req2) || !isset($req3)) {
header( "Location: $form_url" ); }
elseif (empty($req1) || empty($req2) || empty($req3)) {
if ($use_headers =="0"){
echo "$header";
} else { include ("$header"); }
?>
<h2>Error</h2>
<?=$error_required?>
<?
if ($use_footers =="0"){
echo "$footer";
} else { include ("$footer"); }
}
else {
$f_email = $POST[email];
$f_email = strtolower(trim($f_email));
if (is_valid_email($f_email)) {
$msg .= "\n\n---------------\n";
$msg .= "NL-PHPMail v1.5 - <a href="http://codegrrl.com/\n" target="blank">http://codegrrl.com/\n</a>";
$msg .= "---------------\n\n";
$mailheaders = "MIME-Version: 1.0 \n";
$mailheaders .= "Content-type: text/plain; charset=iso-8859-1 \n";
$mailheaders .= "From: \"$f_email\" <$POST[email]> \n";
$mailheaders .= "Reply-To: \"$f_email\" <$POST[email]> \n";
$mailheaders .= "X-Priority: 3 \n";
$mailheaders .= "X-MSMail-Priority: High \n";
$mailheaders .= "X-Mailer: PHP4";
mail($recipient, $subject, $msg, $mailheaders);
if ($use_headers =="0"){
echo "$header";
} else { include ("$header"); }
?>
<h2>Thank You, <?=$name?></h2>
<?=$success_message?>
<?
if ($use_footers =="0"){
echo "$footer";
} else { include ("$footer"); }
} else {
if ($use_headers =="0"){
echo "$header";
} else { include ("$header"); }
?>
<h2>Error</h2>
<?=$error_email?>
<?
if ($use_footers =="0"){
echo "$footer";
} else { include ("$footer"); }
} } ?>