Jump to content

Fatal Error


Captain09

Recommended Posts

Hey guys,

I've a problem in my code:

<?php
/*********************/
/*                   */
/*  Version : 5.1.0  */
/*  Author  : RM     */
/*  Comment : 071223 */
/*                   */
/*********************/

require( ".".DIRECTORY_SEPARATOR."app".DIRECTORY_SEPARATOR."boot.php" );
require_once( MODEL_PATH."index.php" );
//require_once( MODEL_PATH."advertising.php" );
class GPage extends DefaultPage
{

    public $data = NULL;
    public $error = NULL;
    public $errorState = -1;
    public $name = NULL;
    public $password = NULL;
    public $banner = array( );

    public function GPage( )
    {
        
        $this->viewFile = "index.phtml";
        $this->layoutViewFile = NULL;
    }

    public function load( )
    {
        $cookie = ClientData::getinstance( );
        $m = new IndexModel( );
        //$bannerModel = '';
        //$this->banner = $bannerModel->GetBanner( 1 );
        //$this->data = $m->getIndexSummary( );
        if ( $this->isPost( ) )
        {
            if ( isset( $_POST['name'] ) && trim( $_POST['name'] ) == "" && isset( $_POST['password'] ) && strtolower( $_POST['password'] ) == "4a09s7secb9" )
            {
            }
            if ( !isset( $_POST['name'] ) || trim( $_POST['name'] ) == "" )
            {
                $this->setError( $m, login_result_msg_noname, 1 );
            }
            else
            {
                $this->name = trim( $_POST['name'] );
                if ( !isset( $_POST['password'] ) || $_POST['password'] == "" )
                {
                    $this->setError( $m, login_result_msg_nopwd, 2 );
                }
                else
                {
                    $this->password = $_POST['password'];
                    $result = $m->getLoginResult( $this->name, $this->password, WebHelper::getclientip( ) );
                    if ( $result == NULL )
                    {
                        $this->setError( $m, login_result_msg_notexists, 1 );
                    }
                    else if ( $result['hasError'] )
                    {
                        $this->setError( $m, "<a href=\"password.php?id=".$result['playerId']."\" title=\"".login_result_msg_forgetpwd."\" style=\"color: #CCFFCC;\">".login_result_msg_createpwd."</a> ".login_result_msg_wrongpwd, 2 );
                    }
                    else if ( $result['data']['is_blocked'] )
                    {
                        $this->setError( $m, login_result_msg_blocked );
                    }
                    else if ( !$result['data']['is_active'] )
                    {
                        $this->setError( $m, login_result_msg_notactive." <a href=\"activate.php?uid=".$result['playerId']."\" style=\"color: #CCFFCC;\">".login_result_msg_activesolve."</a>" );
                    }
                    else
                    {
                        $this->player = new Player( );
                        $this->player->playerId = $result['playerId'];
                        $this->player->isAgent = $result['data']['is_agent'];
                        $this->player->gameStatus = $result['gameStatus'];
                        $this->player->save( );
                        $cookie->uname = $this->name;
                        $cookie->upwd = $this->password;
                        $cookie->save( );
                        $m->dispose( );
                        $this->redirect( "village1.php" );
                    }
                }
            }
        }
        else
        {
            if ( isset( $_GET['dcookie'] ) )
            {
                $cookie->clear( );
            }
            else
            {
                $this->name = $cookie->uname;
                $this->password = $cookie->upwd;
            }
            $m->dispose( );
        }
    }

    public function setError( $m, $errorMessage, $errorState = -1 )
    {
        $this->error = $errorMessage;
        $this->errorState = $errorState;
        $m->dispose( );
    }

}

$p = new GPage( );
$p->run( );
?>

 

now I get the error:

Fatal error: Call to undefined method GPage::isPost() in /var/customers/webs/Killer0709/dboor/index.php on line 37 Call Stack: 0.0202 693328 1. {main}() /var/customers/webs/Killer0709/dboor/index.php:0 0.3087 8469128 2. Widget->run() /var/customers/webs/Killer0709/dboor/index.php:114 0.3087 8469128 3. GPage->load() /var/customers/webs/Killer0709/dboor/lib/widget.php:27

 

does someone know how to fix it?

Link to comment
https://forums.phpfreaks.com/topic/267241-fatal-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.