3

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.

1

3 Answers 3

15

You can give action to the form_open(),something like this

form_open(base_url().'your_controller_name/function_name');
Sign up to request clarification or add additional context in comments.

1 Comment

form_open(base_url('your_controller_name', 'function_name'));would be actually more appropriate
4

You 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

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.
0

Open App.php

and find and change: public $indexPage = '';

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.