Parse error: syntax error, unexpected '}' in

Discussion in 'PHP' started by cutetyman, Jan 21, 2007.

  1. #1
    Parse error: syntax error, unexpected '}' in /home/poopsey/public_html/xxxxxxxxxxxx/admin/index.php on line 34


    ?>
    Welcome back, <b><? echo $admin_id; ?></b>. Logging you in...
    <script language="Javascript">location.href='<? echo $_SERVER[PHP_SELF]; ?>';</script>
    <?php

    Whats wrong....Hmmmmmmm
     
    cutetyman, Jan 21, 2007 IP
  2. TwistMyArm

    TwistMyArm Peon

    Messages:
    931
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I'm assuming that's not the entire script... which would really help.
     
    TwistMyArm, Jan 21, 2007 IP
  3. cutetyman

    cutetyman Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    This is the the chunk of script that contains the error.....I am at a loss to find it......:confused:
     
    cutetyman, Jan 21, 2007 IP
  4. daboss

    daboss Guest

    Messages:
    2,249
    Likes Received:
    151
    Best Answers:
    0
    Trophy Points:
    0
    #4
    post a bigger chunk of code - no one will be able to help you otherwise...

    you need to help other people to help you...
     
    daboss, Jan 21, 2007 IP
  5. cutetyman

    cutetyman Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    ok, heres more script for ya......who ever solves this error....I would be more then happy to drink a fifth of canadian mist with them.....;)




    require_once( "../inc/header.inc.php" );
    require_once( "{$dir['inc']}db.inc.php" );
    require_once( "{$dir['inc']}admin.inc.php" );
    require_once( "{$dir['inc']}profiles.inc.php" );
    require_once( "{$dir['inc']}design.inc.php" );
    require_once( "{$dir['inc']}admin_design.inc.php" );
    require_once( "{$dir['inc']}utils.inc.php" );

    if ( $_POST['ID'] )
    {
    $admin_id = process_db_input( $_POST['ID'] );
    $admin_pass = process_db_input( $_POST['Password'] );
    $result = db_res( "SELECT * FROM `Admins` WHERE `Name` = '$admin_id' AND `Password` = '$admin_pass'" );
    if ( mysql_num_rows( $result ) != 1 )
    login_form( '<center><b><font color="#ff0000">Login Failed! Try again</font></b></center>', 1 );
    } else {
    setcookie ("adminID", $_POST[ID], 0, "/");setcookie ("adminPassword", crypt( $_POST[Password], 'secret_string' ), 0, "/");

    ?>
    Welcome back, <b><? echo $admin_id; ?></b>. Logging you in...
    <script language="Javascript">location.href='<? echo $_SERVER[PHP_SELF]; ?>';</script>
    <?php
    exit;
    }
     
    cutetyman, Jan 21, 2007 IP
  6. Fl1p

    Fl1p Active Member

    Messages:
    511
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    58
    #6
    View your whole source code and check what's on line 34 and paste it here.
     
    Fl1p, Jan 21, 2007 IP
  7. infernaliuns

    infernaliuns Active Member

    Messages:
    121
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #7
    Try this.....


    <?
    
    require_once( "../inc/header.inc.php" );
    require_once( "{$dir['inc']}db.inc.php" );
    require_once( "{$dir['inc']}admin.inc.php" );
    require_once( "{$dir['inc']}profiles.inc.php" );
    require_once( "{$dir['inc']}design.inc.php" );
    require_once( "{$dir['inc']}admin_design.inc.php" );
    require_once( "{$dir['inc']}utils.inc.php" );
    
    if ( $_POST['ID'] )
    {
    $admin_id = process_db_input( $_POST['ID'] );
    $admin_pass = process_db_input( $_POST['Password'] );
    $result = db_res( "SELECT * FROM `Admins` WHERE `Name` = '$admin_id' AND `Password` = '$admin_pass'" );
    if ( mysql_num_rows( $result ) != 1 ) {
    login_form( '<center><b><font color="#ff0000">Login Failed! Try again</font></b></center>', 1 );
    } else {
    setcookie ("adminID", $_POST[ID], 0, "/");setcookie ("adminPassword", crypt( $_POST[Password], 'secret_string' ), 0, "/");
    
    ?>
    Welcome back, <b><? echo $admin_id; ?></b>. Logging you in...
    <script language="Javascript">location.href='<? echo $_SERVER[PHP_SELF]; ?>';</script>
    <?php
    exit;
    }
    }
    
    ?>
    PHP:
     
    infernaliuns, Jan 21, 2007 IP
  8. projectshifter

    projectshifter Peon

    Messages:
    394
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #8
    For future reference, PHP error page numbers are more of an "approximation" you could say. A lot of times it'll say "error on line 138", but what it really was is an error on a PHP line above it, or sometimes in the chunk above it. Generally it's a forgotten semicolon, a missing parenthese or something along those lines. Also try use <?php echo 'blah'; ?>, short tags are not always enabled and they are harder on the engine.
     
    projectshifter, Jan 21, 2007 IP
  9. cutetyman

    cutetyman Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    I used, infernaliuns....adjustments........and now i get this....

    Parse error: syntax error, unexpected '<' in /home/poopsey/public_html/xxxxxxxxxxxxxxx/admin/index.php on line 10

    and that line is the first line of this posted php code.....what the heck.....

    <?
    require_once( "../inc/header.inc.php" );require_once( "{$dir['inc']}db.inc.
     
    cutetyman, Jan 22, 2007 IP
  10. cutetyman

    cutetyman Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    hey i pasted this in and now i get..

    Parse error: syntax error, unexpected '<' in /home/poopsey/public_html/aeDating-v4.1/admin/index.php on line 10

    line 10 is the beginning of this php code....<?
     
    cutetyman, Jan 22, 2007 IP
  11. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #11
    
    require_once( "../inc/header.inc.php" );
    require_once( "{$dir[inc]}db.inc.php" );
    require_once( "{$dir[inc]}admin.inc.php" );
    require_once( "{$dir[inc]}profiles.inc.php" );
    require_once( "{$dir[inc]}design.inc.php" );
    require_once( "{$dir[inc]}admin_design.inc.php" );
    require_once( "{$dir[inc]}utils.inc.php" );
    
    if ( $_POST['ID'] ){
    $admin_id = process_db_input( $_POST['ID'] );
    $admin_pass = process_db_input( $_POST['Password'] );
    $result = db_res( "SELECT * FROM `Admins` WHERE `Name` = '$admin_id' AND `Password` = '$admin_pass'" );
    if ( mysql_num_rows( $result ) != 1 ){
    login_form( '<center><b><font color="#ff0000">Login Failed! Try again</font></b></center>', 1 );
    } else {
    setcookie ("adminID", $_POST[ID], 0, "/");
    setcookie ("adminPassword", crypt( $_POST[Password], 'secret_string' ), 0, "/");
    
    ?>
    Welcome back, <b><? echo $admin_id; ?></b>. Logging you in...
    <script language="Javascript">location.href='<? echo $_SERVER[PHP_SELF]; ?>';</script>
    <?php
    exit();
    }
    }
    
    PHP:
    Peace,
     
    Barti1987, Jan 22, 2007 IP
  12. cutetyman

    cutetyman Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Success....After a halve a quart of Canadian Whiskey and a high end PHP debugger....One bracket was in the wrong place.....Woo Hooo
     
    cutetyman, Jan 22, 2007 IP
  13. frtaz

    frtaz Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13

    I know this is an old post but what did you do to fix it cutetyman!
     
    frtaz, Nov 17, 2007 IP