PDA

View Full Version : Curly brace error.


Delta_Boy
04-28-2005, 08:20 PM
I cant see anything wrong with my PHP "syntax". I am attempting to create my first script by referring to a few others. Anyways, I get this error.

Parse error: parse error, unexpected '{' in...

I have tried moving the "{" to different locations but it still doesnt work.

The following is the code. The error is on the first line:

if (!eregi("^[[:alnum]][a-z0-9_.-]@[a-z0-9.-]+\.[a-z]{2,4}$",(stripslashes(trim($_POST['email'])))) {
$problem = TRUE;
} else {
$message = .= '<p>Please enter a valid email address!</p>';
}

GCharb
04-29-2005, 11:04 PM
Hello!

You missed a 5th ) on line 2, also, you added an extra = on line 5.

if (!eregi("^[[:alnum]][a-z0-9_.-]@[a-z0-9.-]+\.[a-z]{2,4}$",(stripslashes(trim($_POST['email']))))) {
$problem = TRUE;
} else {
$message .= '<p>Please enter a valid email address!</p>';
}

Delta_Boy
04-30-2005, 06:35 PM
It worked! I thought that I had looked at that but I guess I cant count ;). Now the script is error free till after the last line. There is a variable error. I will plug away to figure that out. Thanks for your help, GC.