Parse error: syntax error, unexpected '{'

bigbubbax

New Member
Messages
7
Reaction score
0
Points
0
Hi all.

Ugh, second plea for help today.

Ok, my php looks like:
(cleanse.php)
PHP:
foreach ($_POST as $one => $two)
{
    echo "$one    ,    $two <br />";
}


/*Checking First Name for: beggins with a Capital, */
if (!ereg("^[A-Z]*" or "*{1,20}" , $N_First)    

{
        echo "<p>Error: The first name must begin with a Capital Letter and be between one and twenty characters.</p>";
        include("Includes/CreationForm.php");
}

else
            {
                echo "it seems to work";
            }
^Part of an include document that is called from the main program^

The main page looks like:
PHP:
<?php
/*This 'if' checks to see if this is the first time the page has been open.
It determines whether to display the Creation Form or begin Cleansing the data.*/
if (!$_POST['N_First'])
    {
        /*The form*/
        echo"First time: form";
        include("Includes/CreationForm.php");
    }
else
{
    include("Includes/Cleanse.php");
}
    
?>
When a $_POST is sent to the page, it gives the following error:
Code:
Parse error:  syntax error, unexpected '{' in  /home/bigbubba/public_html/SketchTest/OldSketch/Includes/Cleanse.php  on line 39

Line 39 is the { after the 'if' statement in the first box.

Google hasn't brought up any useful information for the error.
 
Last edited:

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Code:
if (!ereg("^[A-Z]*" or "*{1,20}" , $N_First)    MISSING A ) HERE

{

.
 

bigbubbax

New Member
Messages
7
Reaction score
0
Points
0
Wow, I can't believe it. That's been tripping me up for hours.

Thanks again, descalzo.
 
Top