In Codeigniter when I use form_open() function it adds index.php to url.
How can remove it ?
Note : I removed index.php from url with htaccess.
3 Answers
You can give action to the form_open(),something like this
form_open(base_url().'your_controller_name/function_name');
1 Comment
Roberto Rizzi
form_open(base_url('your_controller_name', 'function_name'));would be actually more appropriateYou not removed the index.php from $config['index_page'] = "index.php";
/*
|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
//$config['index_page'] = 'index.php';
$config['index_page'] = '';
1 Comment
Esocoder
This answer should have been accepted instead of the other. The other requires to add a base_url() all the time, while removing the index.php from the var index_page inside the config file is the solutions that's been advices if your using mod_rewrite.