[eluser]Unknown[/eluser]
Hello all,
I spent last two days to find the answer. Thanks so much for your help.
Error message is :
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Mlogin::$form_vaidation
Filename: controllers/mlogin.php
Line Number: 34
Code:
<?php
class Mlogin extends CI_Controller
{
public function __construct()
{
parent::__construct();
$this->load->helper(array('form','url'));
$this->load->library('form_validation');
$this->load->database();
$this->output->enable_profiler(TRUE);
}
public function index($msg = NULL)
{
$data['msg'] = $msg ;
$this->load->view('login_view', $data);
}
public function login_process($msg = NULL)
{
$this->load->helper(array('form','url'));
$this->load->library('form_validation');
$data['msg'] = $msg ;
$this->form_vaidation->set_rules('username','username','required');
$this->form_vaidation->set_rules('password','password','required');
if ($this->form_validation->run() == False )
{
$this->load->view('login_view', $data);
}
else
{
$this->load->view('login_view', $data);
}
}
}
?>
<html>
<head>
<title>Gestion des statistiques vacances</title>
<style type="text/css">
h5 {
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 8pt;
color: DarkOrange;
padding-top: 3px;
padding-bottom: 0px;
}
h1 {
font: bold 330%/100% "Lucida Grande";
position: relative;
color: #464646;
}
h1 span {
background: url(gradient.png) repeat-x;
position: absolute;
display: block;
width: 100%;
height: 31px;
}
</style>
<h1><span></span>Login</h1>
</head>
<body>
<?php echo validation_errors(); ?>
<?php echo form_open('mlogin/login_process'); ?>
<?php if(! is_null($msg)) echo $msg; ?>
<!-- ********************************************************************************************************* -->
</br>
<h5>Nom</h5>
<?php $data = array(
'name' => 'UserName',
'id' => 'username',
'value' => '',
'maxlength' => '20',
'size' => '20',
'style' => 'width:50%',
);
?>
<?php echo form_input($data); ?>
<!-- ********************************************************************************************************* -->
</br>
<h5>Mot de passe</h5>
<?php $data = array(
'name' => 'password',
'id' => 'password',
'value' => '',
'maxlength' => '20',
'size' => '20',
'style' => 'width:50%',
);
?>
<?php echo form_input($data); ?>
<!-- ********************************************************************************************************* -->
</br>
</br>
<div><input type="submit" value="Login" /></div>
</form>
</body>
</html>