[PHP] Parse error: syntax error, unexpected '_' (T_STRING)

Closed
mikeoe2003 Posts 25 Registration date Thursday November 1, 2012 Status Member Last seen March 27, 2014 - Aug 18, 2013 at 07:30 AM
 Blocked Profile - Aug 18, 2013 at 10:37 AM
Hello,

I get the the error, could you help me? Thanks.

"Parse error: syntax error, unexpected '_' (T_STRING), expecting ']' in C:\xampp\htdocs\processfeedback.php on line 30"

Line 30 refers to the very first line of the code I have posted below
=================
if (!eregi('^[a-zA-Z0-9_\-\.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$', $email)) {
echo "<p>That is not a valid email address.</p>".
<p>Please return to the previous page and try again.</p>";
exit;
}
$toaddress = "feedback@example.com"; // the default value
if (eregi("shop|customer service|retail", $feedback))
$toaddress = "retail@example.com";
} else if (eregi("deliver|fulfill", $feedback)) {
$toaddress = "fulfillment@example.com";
} else if (eregi("bill|account", $feedback)) {
$toaddress = "accounts@example.com";
}
if (eregi("bigcustomer\.com", $email)) {
$toaddress = "bob@example.com";
}
?>

=======================================

1 reply

Blocked Profile
Aug 18, 2013 at 10:37 AM
So, the code that you cust and pasted doesn't work? I am not certain what you are asking.

This should help with your "Custom Code" Parsing error.
https://ccm.net/faq/595-php-parse-error-unexpected-t-string-expecting-or

I would guess that it is the _ after the first nine.

Have Fun!

//ark
-Contributor
2