base_url and form_open give different output url

#1
[eluser]zarcel[/eluser]
Hello,
I have noticed that base_url('whatever') gives url without index.php for example: http://example.com/whatever

and

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


I believe it should be standardized.

#2
[eluser]PhilTem[/eluser]
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

#3
[eluser]Aken[/eluser]
form_open() uses site_url(), not base_url(). They are different functions for different purposes. Check the URL helper user guide page.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.