CodeIgniter Forums
Missing URI Segment Check - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Missing URI Segment Check (/showthread.php?tid=60905)



Missing URI Segment Check - El Forum - 07-28-2014

[eluser]Unknown[/eluser]
Hello fellow CodeIgniters,

I'm just picking up CodeIgniter once again after a few years out from programming.

I'm currently using the following URL

http://[local domain]/welcome/index/http/404

and pulling my following values
$this->uri->segment(3); = http
$this->uri->segment(4); = 404

However if I remove http and end up with the following url: http://[local domain]/welcome/index/http/404
I want to still be able to pick up the same values ie (
$this->uri->segment(3); = (NULL/FALSE or what ever)
$this->uri->segment(4); = 404
)

Same applies if I miss segment 4 but have segment 3 filled out (
$this->uri->segment(3); = http
$this->uri->segment(4); = (NULL/FALSE or what ever)
)


Catch my drift? What is the best way to do this?

Regards

Jny