[eluser]Achmed1[/eluser]
hi
This is my first post
Im new to codeigniter im having some problems i want to make a simpel login and a validate system example when i put a 4 charater then i get a message like your email must heave more than 4 this is my code.
login.php
Code:
<html>
<head>
<title>Login</title>
<style type="text/css">
body {
background-color: #fff;
margin: 40px;
font-family: Lucida Grande, Verdana, Sans-serif;
font-size: 14px;
color: #4F5155;
}
a {
color: #003399;
background-color: transparent;
font-weight: normal;
}
h1 {
color: #444;
background-color: transparent;
border-bottom: 1px solid #D0D0D0;
font-size: 16px;
font-weight: bold;
margin: 24px 0 2px 0;
padding: 5px 0 6px 0;
}
code {
font-family: Monaco, Verdana, Sans-serif;
font-size: 12px;
background-color: #f9f9f9;
border: 1px solid #D0D0D0;
color: #002166;
display: block;
margin: 14px 0 14px 0;
padding: 12px 10px 12px 10px;
}
</style>
</head>
<body>
<?php echo validation_errors(); ?>
<?php echo form_open('inloggen/logg'); ?>
<h1>Welcome log in </h1>
Name : <input type="text" name="gebruiker" />
Password : <input type="password" name="password"/>
<input type="submit" value="submit" />
</form>
</body>
</html>
inloggen.php
Code:
<?php
class inloggen extends Controller {
function inloggen()
{
parent::Controller();
$this->load->helper(array('form', 'url'));
$this->load->library('form_validation');
}
function index()
{
$this->load->view('login');
}
function post()
{
$this->input->post('gebruiker');
$this->input->post('password');
}
function valideer()
{
$config = array(
array(
'field' => 'gebruiker',
'label' => 'Gebruiker',
'rules' => 'required'|'min_length[5]|max_length[12]'
),
array(
'field' => 'password',
'label' => 'Password',
'rules' => 'required'
)
);
$this->form_validation->set_rules($config);
$this->form_validation->run();
}
function logg()
{
}
}
/* End of file welcome.php */
/* Location: ./system/application/controllers/welcome.php */