Welcome Guest, Not a member yet? Register   Sign In
localhost and $this->uri->segment()
#1

[eluser]matt2012[/eluser]
Im having problems with getting $this->uri->segment()
to work on localhost
if I have this address below

http://localhost/seg1/seg2/seg3

I get these results,

Code:
$this->uri->segment(1) -> ''
$this->uri->segment(2) -> ''
$this->uri->segment(3) -> ''
$this->uri->rsegment(1) -> 'home'
$this->uri->rsegment(2) -> 'index'
$this->uri->rsegment(3) -> ''

only $this->uri->rsegment(1) is as expected

has anyone got the answer to this?
#2

[eluser]frenzal[/eluser]
is your index.php on http://localhost/index.php or is it in http://localhost/seg1/seg2/seg3/index.php ?
#3

[eluser]matt2012[/eluser]
http://localhost/index.php

ive noticed there are some options for $config['uri_protocol'] = "AUTO";
so i will dig into this..
#4

[eluser]matt2012[/eluser]
nope drawing a blank - anyone ?
#5

[eluser]xwero[/eluser]
What do you get when you do
Code:
print_r($this->uri->segments);
#6

[eluser]matt2012[/eluser]
Array ( )
#7

[eluser]xwero[/eluser]
I guess you remove the index.php with .htaccess, right?

Which controller are you using to check the segments?
#8

[eluser]matt2012[/eluser]
thanks xwero - I hadnt enabled mod-rewrite in xampp !! your post got me thinking in the right direction.

Cheers. :-)




Theme © iAndrew 2016 - Forum software by © MyBB