Welcome Guest, Not a member yet? Register   Sign In
base_url and form_open give different output url

I have noticed that base_url('whatever') gives url without index.php for example: http://example.com/whatever


form_open('whatever'); gives url with index.php, example http://example.com/index.php/whatever

I believe it should be standardized.

It is standardized. If you remove the index_page option in your config.php config, then form_open() and base_url() will give the same result.

However, since form_open() basically acts as site_url() it must include index.php for sites that don't have .htaccess with mod-rewrite enabled Wink

form_open() uses site_url(), not base_url(). They are different functions for different purposes. Check the URL helper user guide page.

Theme © iAndrew 2016 - Forum software by © MyBB