Jump to content

Parse Error Need help


muffin100

Recommended Posts

I'm trying to write a register page and this parse error came out:

Parse error: syntax error, unexpected '[' in /usr/local/apache2/htdocs/register.php

Here is part of the code:

if (eregi ('^[[:alpha:]]\.\'\-{2,15}$',stripslashes(trim($POST['name'])))) {
$n = escape_data($_POST['name']);
} else {
$n = FALSE ;
echo '<p><font color="red" size="+1">Please enter a user name!</font></p>';
}

I thought it is the single quotes problem so I have tried this:

if (eregi ('^[[:alpha:]]{2,15}$',stripslashes(trim($POST['name'])))) {
$n = escape_data($_POST['name']);
} else {
$n = FALSE ;
echo '<p><font color="red" size="+1">Please enter a user name!</font></p>';
}

but the same error popped up, can anyone tell me what the problem is?
Link to comment
https://forums.phpfreaks.com/topic/6693-parse-error-need-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.