Possible Duplicate:
Reference - What does this error mean in PHP?
を私は修正せずに、残念ながら、私の問題について多くの質問を見ましたが、。
だから、私の構文のエラーがある:
Fatal error: Using $this when not in object context in ... on line 18.
マイライン18:
echo $this->login;
私の完全なコード:
<?php
class LoginModel extends LoginController {
private $_db;
public $login;
public $pass;
public function __construct() {
$this->_db = Db::getInstance();
$this->login = addslashes(trim($_GET['tgo-root-user']));
$this->pass = addslashes(trim(md5($_GET['tgo-root-password'].SALT)));
}
public function auth() {
echo $this->login;
/*$pdo = $this->_db->prepare("SELECT * FROM `tgo_users` WHERE ((:login = `user_login`) OR (:login = `user_email`)) AND (:user_pw = `user_pw`) ");
$pdo->bindParam(":login", $this->login, PDO::PARAM_STR);
$pdo->bindParam(":user_pw", $this->pass, PDO::PARAM_STR);
$pdo->execute();
if($pdo->rowCount() == 1) {
return true;
} else {
return false;
}*/
}
}
マイコール:
<?php
class LoginController {
public static $status;
public function authenticate() {
$model = new LoginModel();
$this->status = $model->auth();
LoginView::emitAuthResponse();
}
}
だから私は尋ねる:何が間違っているのですか?私はこの問題で多くの時間を失っているし、何が間違っているのか分からない。
ありがとうございます。
こんにちは、KingCrunch。あなたの答えをありがとう - しかし、私はコールでメインポストを編集しました。あれ見て。 –
@GuilhermeOderdenge:他の場所からも電話をかけたり、変更したファイルをアップロードするのを忘れたりしていませんか? – Boann