Welcome Guest, Not a member yet? Register   Sign In
[SOLVED]first URI segment doesn't change after link with second URI segment
#9

[eluser]reaper_unique[/eluser]
Thanks for the replies but just to be clear, "home", "forex", etc. are the segments that refer to the controllers and thus to the index method which loads the "basic" page(/view). "Forex/trading" is referring to the controller "forex" and the method "trading" thus loading the "subpage"(/subview).

I've set a base url but because I'm not allowed to post links I can't give it to you.

The problems lays with the fact that when I visit "base_url/forex/trading", that "forex" stays in the URL when I want to go to, for example, the home page which is linked in the main menu through
Code:
<a href = "home">Home</a>

so instead of going to
Code:
base_url/index.php/home
I go to
Code:
base_url/index.php/forex/home

adding "/" to the links doesn't help, because I don't want to go to the root. That links me to localhost/home instead of base_url/home.

doing:
Code:
a href="&lt;?php echo site_url();?&gt;/home">Home</a>

obviously works, but I want to keep the php in my views as low as possible.

Edit:
Oh stupid me, I just had to add "../" and it works XD
for some reason I did something wrong the first time I tried it.

Thanks for the replies though, really stupid how I wasted my time on this.


Edit 2:
While I'm at it, might as well ask if it's possible to make a newsletter signup function that I can call upon everytime I load a page?


Messages In This Thread
[SOLVED]first URI segment doesn't change after link with second URI segment - by El Forum - 04-27-2011, 08:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB