joel2007 Posted February 21, 2007 Share Posted February 21, 2007 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 Quote Link to comment Share on other sites More sharing options...
skali Posted February 21, 2007 Share Posted February 21, 2007 Although i don't think that this line is causing the problem. May be some other piece of code is generating this error. You can use $_SERVER["HTTP_REFERER"] instead of getenv( "HTTP_REFERER" ); Quote Link to comment Share on other sites More sharing options...
joel2007 Posted February 21, 2007 Author Share Posted February 21, 2007 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 ; ?> Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted February 21, 2007 Share Posted February 21, 2007 Is that you're entire script? If not please indicate which line is getting the error and the exact error message. Ken Quote Link to comment Share on other sites More sharing options...
joel2007 Posted February 21, 2007 Author Share Posted February 21, 2007 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 Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 21, 2007 Share Posted February 21, 2007 $mailto = info@cleavageonline.com' ; Missing your first ' $mailto = 'info@cleavageonline.com' ; Quote Link to comment Share on other sites More sharing options...
joel2007 Posted February 21, 2007 Author Share Posted February 21, 2007 Wow, thanks! I don't know how I overlooked such a simple mistake.. I was sure all of my context was correct! Thanks again and have a great day... Regards Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.