Welcome Guest, Not a member yet? Register   Sign In
how to redirect to welcome controller without removing validation_errors ();
#1

[eluser]my9006ci[/eluser]
i have welcome controller
Code:
<?php

class Welcome extends Controller {

    function Welcome()
    {
        parent::Controller();
    }
    
    function index()
    {   $this->load->library('login');
        $data['body'] = $this->login->login();
        $this->load->view('body',$data);
    }
}
    
?>
and i have login library
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Login {

    var $CI = null;
    public function __construct(){
        $this->CI =& get_instance();
    }
    function Login() {
        $result = '';
        $result .= $this->CI->login->form();
        return $result;
    }
    function form() {
        $result .= validation_errors();
        $result .= form_open('login/login/',array('id'=>'loginform'));
        $result .= form_label('What is your Name').''.form_input(array('name'=>'username','class'=>'input'));
        $result .= form_label('Your Password').''.form_password(array('name'=>'password','class'=>'input'));
        $result .= form_submit(array('name'=>'button','class'=>'submit','value'=>'Login'));
        $result .= form_close();
        return $result;
    }
}

?>
and i have login controller
Code:
<?php

class login extends Controller {
    
    function login()
    {
        $this->load->helper(array('form', 'url'));
        
        $this->load->library('form_validation');
                
        if ($this->form_validation->run() == FALSE)
        {
            $this->load->view('myform');
        }
        else
        {
            $this->load->view('formsuccess');
        }
    }
}
?>
I want to replace
Code:
$this->load->view('myform');
and
Code:
$this->load->view('formsuccess');
how to redirect to welcome controller without removing validation_errors ();


Messages In This Thread
how to redirect to welcome controller without removing validation_errors (); - by El Forum - 06-11-2010, 03:00 AM



Theme © iAndrew 2016 - Forum software by © MyBB