I have reading some of the other posts relating the same error I that am getting but I have not quite found the way to see the error in my script.

    public function chtmlblock( $name, $html_path )
    {
        $this->m_name = $name;
        $this->m_root = $this;
        if ( $html_path != null )
        {
            $Var_360->CHtml( );
            $this->m_html = $Var_360;
            LoadTemplate( $html_path, "main" );
            global $g;
            global $l;
            global $p;
            global $xajax;
            global $g;
            if ( !empty( "xajax" ) && $p != "flashchat.php" )
            {
                $sJsFile = strpos( $_SERVER['HTTP_HOST'], "abc" ) === false ? "xajax_js/xajax.js" : "xajax_js/xajax_noalerts.js";
                setvar( "xajax_js", getJavascript( $g['path']['url_main'].$g['to_root']."_server/", $sJsFile ) );

The error is in line 23 - if ( !empty( "xajax" ) && $p != "flashchat.php" )

What am not seeing?

    !empty( "xajax" )

    This is meaningless (and would break pre-v5.5, see [man]empty[/man]) - it's always going to be true, because a non-empty literal string is always nonempty. I'd guess you meant to write [font=monospace]$xajax[/font].

    Aside from that there are no parse errors in your code - but it just seems wrong to have so many global variables in an object method.

      This is a project I am try to learning php from. It was originally written using v5.2, so I am trying to learn php by means of rewriting it to be complaint to 5.6
      I am very green and new when it comes to php... so this is a bit of a learning curve, but I am enjoying the challenge.

        Write a Reply...