Jump to content

$http_referrer = getenv( "HTTP_REFERER" );


joel2007

Recommended Posts

Hi All.. I've searched the forums and still can't find an answer to my Q.. I think I have a simple one for you.. You could probably assume I'm new to PHP.. I'm getting a;

 

Parse error: parse error, unexpected '@' in /var/www/feedback.php on line 55.. I believe it has something to do with this line;

 

$http_referrer = getenv( "HTTP_REFERER" );

 

It's just a standard contact form.. This line is naturally telling the email recipient of the form who the form is coming from...

 

I'm certain all context is correct... Is there some alternate command I can use? Maybe the server isn't supporting this type of command? I've done phpinfo on the server and it is running Version 4.3.10-18... Any suggestions PLS?

 

Regards

Link to comment
Share on other sites

Thank you.. I tried it but I'm stilling getting the same error.. And actually, I'm sorry, the error is on line 54.. I suppose I should had included the code;

 

 

$headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n" ;

$fname = $_POST['fname'] ;

$lname = $_POST['lname'] ;

$street = $_POST['street'] ;

$city = $_POST['city'] ;

$state = $_POST['state'] ;

$zip = $_POST['zip'] ;

$phone = $_POST['phone'] ;

$email = $_POST['email'] ;

$comments = $_POST['comments'] ;

 

$http_referrer = getenv( "HTTP_REFERER" );

 

if (!isset($_POST['email'])) {

header( "Location: $formurl" );

exit ;

}

if (empty($fname) || empty($email) || empty($comments)) {

  header( "Location: $errorurl" );

  exit ;

}

if ( ereg( "[\r\n]", $fname ) || ereg( "[\r\n]", $email ) ) {

header( "Location: $errorurl" );

exit ;

}

 

if (get_magic_quotes_gpc()) {

$comments = stripslashes( $comments );

}

 

$messageproper =

 

"This message was sent from:\n" .

"$http_referrer\n" .

"------------------------------------------------------------\n" .

"First Name: $fname\n" .

"Last Name: $lname\n" .

"Street: $street\n" .

"City: $city\n" .

"State: $state\n" .

"Zip: $zip\n" .

"Phone#: $phone\n" .

"Email of sender: $email\n" .

      "------------------------- COMMENTS -------------------------\n\n" .

      "Comments: $comments\n\n" .

"\n\n------------------------------------------------------------\n" ;

 

mail($mailto, $subject, $messageproper,

"From: \"$fname\" <$email>" . $headersep . "Reply-To: \"$fname\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.07" );

header( "Location: $thankyouurl" );

exit ;

 

?>

 

 

 

Link to comment
Share on other sites

Yes, that is the entire script (except for the disclaimer stuff).. Here, I'll post the entire script.. The error I get is;

 

Parse error: parse error, unexpected '@' in /var/www/feedback.php on line 8

 

The filename is feedback.php obviously  :)

 

Code;

 

<?
// ------------- CONFIGURABLE SECTION ------------------------

// $mailto - set to the email address you want the form
// sent to, eg
//$mailto		= "youremailaddress@example.com" ;

$mailto = info@cleavageonline.com' ;

// $subject - set to the Subject line of the email, eg
//$subject	= "Feedback Form" ;

$subject = "Contact Form From CleavageOnline" ;

// the pages to be displayed, eg
//$formurl		= "http://www.cleavageonline.com/contact2.html" ;
//$errorurl		= "http://www.example.com/error.html" ;
//$thankyouurl	= "http://www.example.com/thank-you.html" ;

$formurl = "http://www.cleavageonline.com/contact2.html" ;
$errorurl = "http://www.cleavageonline.com/error.html" ;
$thankyouurl = "http://www.cleavageonline.com/thank-you.html" ;

$uself = 0;

// -------------------- END OF CONFIGURABLE SECTION ---------------

$headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n" ;
$fname = $_POST['fname'] ;
$lname = $_POST['lname'] ;
$street = $_POST['street'] ;
$city = $_POST['city'] ;
$state = $_POST['state'] ;
$zip = $_POST['zip'] ;
$phone = $_POST['phone'] ;
$email = $_POST['email'] ;
$comments = $_POST['comments'] ;

$http_referrer = getenv( "HTTP_REFERER" );

if (!isset($_POST['email'])) {
header( "Location: $formurl" );
exit ;
}
if (empty($fname) || empty($email) || empty($comments)) {
   header( "Location: $errorurl" );
   exit ;
}
if ( ereg( "[\r\n]", $fname ) || ereg( "[\r\n]", $email ) ) {
header( "Location: $errorurl" );
exit ;
}

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

$messageproper =

"This message was sent from:\n" .
"$http_referrer\n" .
"------------------------------------------------------------\n" .
"First Name: $fname\n" .
"Last Name: $lname\n" .
"Street: $street\n" .
"City: $city\n" .
"State: $state\n" .
"Zip: $zip\n" .
"Phone#: $phone\n" .
"Email of sender: $email\n" .
      "------------------------- COMMENTS -------------------------\n\n" .
      "Comments: $comments\n\n" .
"\n\n------------------------------------------------------------\n" ;

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

?>

 

 

Any help is GREATLY appreciated! Thanks...

 

Regards

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.