Welcome Guest, Not a member yet? Register   Sign In
Beginner gets some problem
#1

[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 : &lt;input type="text" name="gebruiker" /&gt;
Password : &lt;input type="password" name="password"/&gt;
&lt;input type="submit" value="submit" /&gt;

&lt;/form&gt;

&lt;/body&gt;
&lt;/html&gt;


inloggen.php

Code:
&lt;?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 */


Messages In This Thread
Beginner gets some problem - by El Forum - 10-09-2010, 02:45 PM
Beginner gets some problem - by El Forum - 10-09-2010, 10:56 PM
Beginner gets some problem - by El Forum - 10-10-2010, 05:09 AM
Beginner gets some problem - by El Forum - 10-10-2010, 07:12 AM
Beginner gets some problem - by El Forum - 10-10-2010, 09:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB