Welcome Guest, Not a member yet? Register   Sign In
passing variable in URL
#2

[eluser]tonanbarbarian[/eluser]
this depends on how you get the data
if you use
Code:
$this->uri->segment(n);
Then something like this
Code:
&lt;?=anchor('index.php?/display_add/details/'.$city, '<img src="images/find.gif" border="0" alt="">');?&gt;

If like me you prefere to make an array of segments using
Code:
$this->uri->uri_to_assoc(n);
then you would use something like
Code:
&lt;?=anchor('index.php?/display_add/details/city/'.$city, '<img src="images/find.gif" border="0" alt="">');?&gt;
then
Code:
$segments = $this->uri->uri_to_assoc(3);
would produce
Code:
$segments[array]
(
  'city'=>xyz,
)
I prefer this because the segments can then be added in any order of matching pairs and the url still works


Messages In This Thread
passing variable in URL - by El Forum - 06-22-2009, 04:44 PM
passing variable in URL - by El Forum - 06-22-2009, 04:54 PM
passing variable in URL - by El Forum - 06-22-2009, 04:56 PM
passing variable in URL - by El Forum - 06-22-2009, 04:58 PM



Theme © iAndrew 2016 - Forum software by © MyBB