1
這裏我控制器未定義的變量
class Admin extends CI_Controller {
function __construct(){
parent::__construct();
}
public function index($msg = NULL) {
$data['msg'] = $msg;
$this->load->view('pages/sign-in');
}
public function process(){
// Load the model
$this->load->model('admin/Admin_model');
// Validate the user can login
$result = $this->Admin_model->validate();
// Now we verify the result
if(! $result){
// If user did not validate, then show them login page again
$msg = '<font color=red>Invalid username and/or password.</font><br />';
$this->index($msg);
}else{
// If user did validate,
// Send them to members area
redirect(base_url().'index.php/home');
}
}
,這裏是查看文件我使用:
if(! is_null($msg)) echo $msg;
它顯示
不確定的變量$味精
你用什麼路徑訪問索引控制器? – ajmedway
餵養任何參數? – ajmedway
http://betaonetesting.com/watch_new/index.php/admin – Pardeep