uri_string() has / in front of string [solved] |
[eluser]codeamatic[/eluser]
I looked over the CodeIgniter User Guide and when they called uri_string() on the url http://some-site.com/blog/comments/123 it returns "blog/comments/123", but whenever I call this function it it returns the segments following a "/" such as "/blog/comments/123". Is there a way to stop this? Basically I'm just trying to get the current url, but without having to deal with "index.php" being a part of it (therefore current_url() is out). Any ideas as to why it is putting an additional slash(/) in front of my uri string?
[eluser]bcorcoran[/eluser]
Make sure around approx line 26 in /system/application/config/config.php is: $config['index_page'] = ""; That's the only reason I can think of for this.
[eluser]GSV Sleeper Service[/eluser]
the url helper documentation is wrong, if you look at uri_string() in the url helper, you'll see it just calls the uri_string method in the URI class. Quote:Returns a string with the complete URI. For example, if this is your full URL:
[eluser]codeamatic[/eluser]
thanks so much brendanc, that was the exact problem, now current_url() does exactly what I needed.
[eluser]bcorcoran[/eluser]
[quote author="webbo11" date="1237576351"]thanks so much brendanc, that was the exact problem, now current_url() does exactly what I needed.[/quote] Glad that fixed it for you-- however GSV is correct about the uri_string documentation error. Also just make sure that you've got your .htaccess set up as per the wiki or the user guide |
Welcome Guest, Not a member yet? Register Sign In |