+ Reply to Thread
Results 1 to 3 of 3

Thread: Parse error: syntax error, unexpected '{'

  1. #1
    bigbubbax is offline x10Hosting Member bigbubbax is an unknown quantity at this point
    Join Date
    Feb 2010
    Posts
    7

    Parse error: syntax error, unexpected '{'

    Hi all.

    Ugh, second plea for help today.

    Ok, my php looks like:
    (cleanse.php)
    PHP Code:
    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 Code:
    <?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 by bigbubbax; 03-07-2010 at 09:32 PM. Reason: more information

  2. #2
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,267

    Re: Parse error: syntax error, unexpected '{'

    Code:
    if (!ereg("^[A-Z]*" or "*{1,20}" , $N_First)    MISSING A ) HERE
    
    {
    .
    Nothing is always absolutely so.

  3. #3
    bigbubbax is offline x10Hosting Member bigbubbax is an unknown quantity at this point
    Join Date
    Feb 2010
    Posts
    7

    Re: Parse error: syntax error, unexpected '{'

    Wow, I can't believe it. That's been tripping me up for hours.

    Thanks again, descalzo.

+ Reply to Thread

Similar Threads

  1. Parse error: syntax error (PHP)
    By port5900 in forum Programming Help
    Replies: 2
    Last Post: 11-30-2008, 04:47 PM
  2. PHP Parse Syntax Error
    By richm8026 in forum Programming Help
    Replies: 7
    Last Post: 10-28-2008, 12:16 PM
  3. Parse error: syntax error, unexpected
    By Fr33z4r in forum Free Hosting
    Replies: 12
    Last Post: 11-04-2007, 07:12 PM
  4. Replies: 9
    Last Post: 10-11-2007, 12:45 PM
  5. unexpected error
    By swirly in forum Scripts & 3rd Party Apps
    Replies: 8
    Last Post: 05-04-2006, 07:14 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers