basshook
03-08-2008, 03:49 AM
Hi all, I'm new to php and this forum and have a question with a form script I'm using and maybe someone could help me with or point in the right direction. I've searched other posts and based on what I've found and read I believe I've made sure there were no white spaces etc. The error message is as follows:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/bottleca/public_html/forms/battleofbrands/processor.php on line 9
Here is the file I'm trying to set up (i've highlighted the code that seems to be causing me the grief):
<?php
$where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));
session_start();
if( ($_SESSION['security_code']==$_POST['security_code']) && (!empty($_POST['security_code'])) ) {
mail("help@bottlecaplure.com","Battle of the Brands Question","Form data:
" . $mail_message .= "Form Submitted by IP Address: ".$_SERVER['REMOTE_ADDR']."\n" . "
if (ereg(^([a-zA-Z0-9_-.]+)@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)|(([a-zA-Z0-9-]+.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(]?)$, $_POST['email'])) {
echo "<br>Please enter a valid e-mail address.";
}
Question: " . $_POST['field_1'] . "
Your email address: " . $_POST['field_2'] . "
");
include("confirm.html");
}
else {
echo "Invalid Captcha String.";
}
?>
Basshook
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/bottleca/public_html/forms/battleofbrands/processor.php on line 9
Here is the file I'm trying to set up (i've highlighted the code that seems to be causing me the grief):
<?php
$where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));
session_start();
if( ($_SESSION['security_code']==$_POST['security_code']) && (!empty($_POST['security_code'])) ) {
mail("help@bottlecaplure.com","Battle of the Brands Question","Form data:
" . $mail_message .= "Form Submitted by IP Address: ".$_SERVER['REMOTE_ADDR']."\n" . "
if (ereg(^([a-zA-Z0-9_-.]+)@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)|(([a-zA-Z0-9-]+.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(]?)$, $_POST['email'])) {
echo "<br>Please enter a valid e-mail address.";
}
Question: " . $_POST['field_1'] . "
Your email address: " . $_POST['field_2'] . "
");
include("confirm.html");
}
else {
echo "Invalid Captcha String.";
}
?>
Basshook