为什么会有性欲免费。A。片网址92huo.c。C。O。M

php - CodeIgniter - Call to a member function model() on a non-object - Stack Overflow
Join the Stack Overflow Community
Stack Overflow is a community of 7.0 million programmers, just like you, helping each other.
J it only takes a minute:
This question already has an answer here:
I have a login form that is being created in the view. Then in my controller I'm trying to load my model but it doesn't seem to load. Looked up a few answer here on stackoverflow and almost everybody says autoload model, import the database library,etc. I did that but I'm still getting the error
Fatal error: Call to a member function model() on a non-object in C:\xampp\htdocs\\project\application\controllers\login.php on line 11
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Login::$load
Filename: controllers/login.php
Line Number: 11
login_view
$loginEmail = array('placeholder' =& "Email", 'name' =& "loginEmail");
$loginPassword = array('placeholder' =& "Wachtwoord", 'name' =& "loginPassword");
$loginSubmit = array('name' =& "loginSubmit", 'class' =& "btn", 'value' =& "Inloggen");
$loginForgot = array('name' =& "loginForgot", 'class' =& "link", 'value' =& "Wachtwoord vergeten?");
echo form_open('login/login', array('class' =& 'grid-100 formc'));
echo form_input($loginEmail);
echo form_password($loginPassword);
echo form_submit($loginSubmit);
echo form_submit($loginForgot);
login_controller
Class Login extends CI_Controller{
function index(){
$data['content'] = 'login_view';
$this-&load-&view('templates/template', $data);
function login(){
$this-&load-&model('login_model');
$query = $this-&login_model-&validate();
if($query){
$data = array(
'username' =& $this-&input-&post('loginEmail'),
'loggedin' =& true
$this-&session-&set_userdata($data);
redirect('profile/myprofile');
login_model
Class Login_model extends CI_Model{
function validate(){
$this-&db-&where('email', $this-&input-&post('loginEmail'));
$this-&db-&where('password', md5($this-&input-&post('loginPassword')));
$query = $this-&db-&get('tbl_users');
if($query-&num_rows == 1){
autoload.php
$autoload['libraries'] = array('database', 'session');
What am I missing here?
44.2k1569127
1,59492646
marked as duplicate by , , , , Mike W
This question has been asked before and already has an answer. If those answers do not fully address your question, please .
You don't have a constructor, in your login controller:
public function __construct() {
parent::__construct();
1,59492646
According to CodeIgniter docs
If you intend to use a constructor in any of your Controllers, you MUST place the following line of code in it:
parent::__construct();
Not the answer you're looking for?
Browse other questions tagged
rev .25708
Stack Overflow works best with JavaScript enabled

我要回帖

更多关于 92huo.c 的文章

 

随机推荐