[eluser]SamoualSys[/eluser]
Fatal error: Cannot redeclare class User in C:\xampp\htdocs\test\application\models\user.php on line 36
i have this error msg with white screen
my model code is
Code:
<?php
Class User extends CI_Model
{
function login($user, $pass)
{
$this -> db -> select('id, user, password');
$this -> db -> from('users');
$this -> db -> where('user = ' . "'" . $user . "'");
$this -> db -> where('password = ' . "'" . MD5($pass) . "'");
$this -> db -> limit(1);
$query = $this -> db -> get();
if($query -> num_rows() == 1)
{
return $query->result();
}
else
{
return false;
}
}
function insert_user()
{
$this->user = $_POST['username']; // inser new user to data base
$this->password = $_POST['password'];
$this->email = $_POST['email'];
// $this->date = time();
$this->db->insert('users', $this);
return ;
}
}?>
my controler code is
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class User extends CI_Controller {
function __construct()
{
parent::__construct();
}
function index()
{
if($this->session->userdata('logged_in'))
{
$session_data = $this->session->userdata('logged_in');
$userlogin['user'] = $session_data['user'];
$this->load->view('user',$userlogin);
}
else
{
//If no session, redirect to login page
redirect('login', 'refresh');
}
}}
?>
can you help and explain what this error mean please