i am stuck in segments in codeigniter because it is new to me,
the problem with my login form.
i gave the url in action like action="blog/login/getLog" and
my login form shows in the url like blog/login
i know that in controller class i just create a function like with the name login but i created my controller file like this:
class Blog extends CI_Controller{
function __construct(){
parent::__construct();
}
// Now See
function _remap( $method ){
$this->load->view('header');
switch( $method ){
case 'about':
$this->load->view('about');
break;
case 'login':
$this->load->view('login');
break;
case 'services':
$this->load->view('service');
break;
}
$this->load->view('footer');
}
}//Close Class
but now don’t know how to handle both segment like login and login/getLog .
EDIT: What happen exactly, when i click on the login button then i just see the login form according to _remap() and the url like blog/login and when i submitted the form and the url looking like blog/login/getLog, the login form still looking but i want to redirect it on success.. or want to detect the segment getLog if possible in the case 'login': if possible.
Thanks in advanced.
If you are sending through the URL, just use uri class:
If you are sending in a form, send the variable through the form. Perhaps a hidden field?
Edit: I’m not quite sure why you are using _remap for this w/o routing to another function (you are only trying to call a view file instead)
This is how I would expect to see the login form:
Then in your Blog class i would rather put a function
Edit 2:
In case there are confusions and you actually want to use remap. You can do it like this to get the variables also.