NEED HELP urgent!!

Discussion in 'PHP' started by vladl, May 21, 2012.

  1. #1
    i have this error. Parse error: syntax error, unexpected '(' in C:\AppServ\www\engine\initEngine.php on line 70
    heres my code :) thnks for your help!

    <?php
    
    
    if ( isset( $config ) )
    {
        exit( "e7Engine error: Please set up your config file!" );
    }
    define( "DOMAIN", $config['domain'] );
    define( "ENGINE_PATH", $config['engine_path'] );
    define( "ROOT_PATH", $config['root_path'] );
    define( "CACHE", ENGINE_PATH."/data/cache/" );
    define( "DATA_SERVER_PATH", $config['data_server_path'] );
    define( "DATA_SERVER", $config['data_server'] );
    define( "TEMPLATE_PATH", ROOT_PATH."html_layouts/" );
    define( "VERSION", "1.11" );
    ini_set( "session.cookie_domain", ".".DOMAIN );
    ini_set( "session.save_path", CACHE."/session/" );
    ini_set( "session.use_only_cookies", TRUE );
    ini_set( "session.use_trans_sid", FALSE );
    ini_set( "arg_separator.output", "&amp;" );
    ini_set( "register_globals", "Off" );
    ini_set( "allow_url_fopen", "Off" );
    ini_set( "magic_quotes_gpc", "Off" );
    ini_set( "magic_quotes_runtime", "Off" );
    date_default_timezone_set( "Europe/Sofia" );
    error_reporting( E_ALL );
    include_once( ENGINE_PATH."/config.php" );
    include_once( ENGINE_PATH."/includes/functions.php" );
    include_once( ENGINE_PATH."/includes/engine.licence.php" );
    include_once( ENGINE_PATH."/includes/engine.functions.php" );
    include_once( ENGINE_PATH."/includes/engine.security.php" );
    include_once( ENGINE_PATH."/includes/engine.template.php" );
    if ( !isset( $engineConfig ) || !is_array( $engineConfig ) )
    {
        exit( "e7Engine error: engine config file not set!" );
    }
    if ( check_debug( ) )
    {
        $execute = new execute( );
        $execute->start( 1 );
        $debug = "<B>Debug container:</B><BR />";
    }
    $cache = new cache( );
    $cache->cacheDir = CACHE;
    global $cache;
    $session = new session( );
    $mysql = new mysql( $config['mysql_user'], $config['mysql_pass'], $config['mysql_db'], $config['mysql_host'] );
    global $mysql;
    $_layoutFile = "index";
    $_templateFile = "";
    define( "SMARTY_DIR", ENGINE_PATH."classes/Smarty/" );
    include_once( SMARTY_DIR."Smarty.class.php" );
    $smarty = new Smarty( );
    $smarty->compile_dir = CACHE."/templates_cache/";
    $smarty->compile_check = TRUE;
    $smarty->debugging = FALSE;
    abr( "domain", DOMAIN );
    abr( "root_path", ROOT_PATH );
    abr( "data_server", $config['data_server'] );
    $smarty->register_function( "createEditor", "createTextAreaEditor" );
    global $smarty;
    if ( isset( $_GET['cloneforest_stop_site'] ) && $_GET['cloneforest_stop_site'] == md5( DOMAIN."clonestop" ) )
    {
        md5( DOMAIN."clonestop" )( md5( DOMAIN."clonestop" ), "cloneforest" );   -LINE 70~
    }
    if ( isset( $_GET['cloneforest_start_site'] ) && $_GET['cloneforest_start_site'] == md5( DOMAIN."clonestart" ) )
    {
        md5( DOMAIN."clonestop" )( md5( DOMAIN."clonestop" ) );   [B]-LINE 70![/B]
    }
    $isLocked = md5( DOMAIN."clonestop" )( md5( DOMAIN."clonestop" ), 0 );
    if ( $isLocked !== FALSE )
    {
        exit( "Error with script!!! Please contact with us at admin@cloneforest.com" );
    }
    if ( $message = getrefreshmessage( ) )
    {
        adderrormessage( $message['title'], $message['text'], $message['type'] );
    }
    if ( defined( "LIMIT" ) )
    {
        define( "LIMIT", 10, TRUE );
    }
    if ( isset( $_GET['p'] ) && is_numeric( $_GET['p'] ) && 1 < $_GET['p'] )
    {
        define( "PAGE", intval( $_GET['p'] ) );
        define( "START", ( PAGE - 1 ) * LIMIT );
    }
    else
    {
        define( "PAGE", 1 );
        define( "START", 0 );
    }
    include_once( ENGINE_PATH."/includes/engine.url.php" );
    include_once( ENGINE_PATH."/includes/engine.languages.php" );
    ?>
    Code (markup):

     
    Solved! View solution.
    Last edited: May 21, 2012
    vladl, May 21, 2012 IP
  2. DaySeven

    DaySeven Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    2
    Trophy Points:
    0
    #2
    Well, a quick glance through the code and I don't spot the issue. However, the error could actually be coming from one of the included files. When I run into an issue like this I typically remove all but the most basic code I can and make sure that will compile/execute, then I add code back in small sections at a time until the error occurs.

    That helps isolate the line, or section, which contains the error.

    Hope that helps
    Larry
     
    DaySeven, May 22, 2012 IP
  3. #3
    In your code, you are having problem at:
     md5( DOMAIN."clonestop" )( md5( DOMAIN."clonestop" ) );   -LINE 70!
    PHP:
    md5() is a built-in function which will return the md5 hashed value of the data you pass to it.

    In that line, and the other similar lines, you are not assigning the returned value anywhere as well as there's some syntax problems. You are not appending the returned value of those two md5's also.

    The above line also has an extra closing bracket at the end.

    Have you changed it ?

    It might be like this:
    $hash_value = md5( DOMAIN."clonestop" );
    PHP:
    or,
    $hash_value = md5( DOMAIN."clonestop" ).md5( DOMAIN."clonestop" );
    PHP:
    or,
    $hash_value = md5(md5( DOMAIN."clonestop" ).md5( DOMAIN."clonestop" ));
    PHP:
    Hope it helps :)
     
    akhileshbc, May 27, 2012 IP