Web Hosting Talk







View Full Version : Parse error: parse error, unexpected T_ELSE in /var/www/html/register2.php on line 14


blackbelt080
09-25-2003, 11:03 AM
Here is the code:
//Handle the form
require_once (".//../mysql_connect.php"); //Connect to the db
//Check for the first name
if (eregi('^[:alpha:]'. "{2,15}$", stripslashes(trim("$_POST['first_name']")))); {
$fn = escape_data("$_POST['last_name']");
} else {
$fn = FALSE;
echo "<p><font color = "red" size = "+1">Please enter your last name!</font></p>";
}


Take care,
Lori :P

blackbelt080
09-25-2003, 11:29 AM
Here is the code: $fn = escape_data"($_POST[last_name])";

Take care,
Lori :D

Ospinto
09-25-2003, 11:53 AM
take the semicolon ( ; ) out after the ))))
hence proper code:
if (eregi('^[:alpha:]'. "{2,15}$", stripslashes(trim("$_POST['first_name']")))) {

cheers

blackbelt080
09-25-2003, 12:03 PM
It didn't matter with or without ;.

Take care,
Lori :D

blackbelt080
09-25-2003, 12:41 PM
I changed the nesting some and deleted the ; and wala!!!!

Take care,
Lori :D