[eluser]seontist[/eluser]
Hi all,
I am new to codeigniter and have managed to get through all the tutorials with some difficulty, due to some outdated stuff.
Anyway, i am experimenting with Simple Secure Library to create a login for a new site i am building but keep running into the same error here is my controller,
Code:
class Signup extends CI_Controller
{
function __construct()
{
parent::__construct();
$this->load->library('SimpleLoginSecure');
}
function index()
{
$this->load->view('signup');
}
function create_user()
{
$this->load->library('form_validation');
$useremail= $this->input->post('user_email');
$password = $this->input->post('user_pass');
$this->simpleloginsecure->create('$useremail', '$password!', false);
//$this->load->view('signup');
}
}
and the view
Code:
<!DOCTYPE html>
<html>
<head>
<title>SIGNUP VIEW</title>
</head>
<body>
The content of the SIGNUP VIEW......
<p>Login Info</p>
<?php
echo form_open('signup/create_user');
echo form_input('user_email', set_value('email', 'Email'));
echo form_input('user_pass', set_value('password', 'Password'));
echo form_input('password2', 'Password Confirm');
echo form_submit('submit', 'Create Acccount');
//echo $username;
//echo $password;
?>
<p><?php //echo validation_errors('<p class="error">'); ?></p>
</body>
</html>
and finally the error.
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Signup::$db
Filename: libraries/SimpleLoginSecure.php
Line Number: 61
( ! ) Fatal error: Call to a member function where() on a non-object in C:\wamp\www\ci_basic\application\libraries\SimpleLoginSecure.php on line 61
Call Stack
# Time Memory Function Location
1 0.0040 700048 {main}( ) ..\index.php:0
2 0.0064 793048 require_once( 'C:\wamp\www\ci_basic\system\core\CodeIgniter.php' ) ..\index.php:202
3 0.0412 2864760 call_user_func_array ( ) ..\CodeIgniter.php:359
4 0.0412 2864840 Signup->create_user( ) ..\CodeIgniter.php:359
5 0.0631 3190856 SimpleLoginSecure->create( ) ..\signup.php:23
I know i am missing something but cant seem to figure out what it is.
Can someone please point me in the right direction, i would really appreciate that.
Thanks