Form Action |
[eluser]AbyJaby[/eluser]
Hi everyone, Can anyone tell me what should i do in case of form submission while submitting my login form if contains username or password incorrect renders an error and redirects to same login page again for eg; http://localhost/codeigniter/index.php/l...thenticate. if again I click on submit the url will be http://localhost/codeigniter/index.php/l...thenticate public function authenticate() { $this->load->model('Loginmodel'); $username = trim(stripslashes(strtolower($_POST['username']))); $password = trim(stripslashes(strtolower($_POST['password']))); $verify = $this->Loginmodel->getData($username, $password); if($verify) echo '<h1 align="center">Login Successful!!</h1>'; else { $this->session->set_userdata('error','Username Password Mismatch!!!'); redirect('login/index'); } } FOR VIEWS PAGE <form action="index.php/login/authenticate" method="post"> Please help me.
[eluser]Chathuranga Tennakoon[/eluser]
it will be easy to give an answer if you can post your code segments here. then i can tell u what u have to do for achieving your requirement. anyway i will give you a short clue on achieving this. just load the login view if the login credentials are failed.
[eluser]AbyJaby[/eluser]
Can u give me the example of full url in case of localhost.
[eluser]louisl[/eluser]
Use CI's form and url helper to generate your form code. Makes life much easier. Code: echo form_open(site_url('login/authenticate')); http://ellislab.com/codeigniter/user-gui...elper.html http://ellislab.com/codeigniter/user-gui...elper.html
|
Welcome Guest, Not a member yet? Register Sign In |