Welcome Guest, Not a member yet? Register   Sign In
Getting query string in Codeigniter
#1

[eluser]OneCorea[/eluser]
Hi!,
when I am using GET method in the <form method...>
the query string is attached to the URL like URL?parm1=value1&param2=value2
As far as I know in the query string, the sequence order of the each parameters is not significant.

but, in CI, if I'd like to use the URL segment method,
what if the null segment value in the middle of many segments?
"www.your-site.com/class/function/id1/value1/id2/value2/id3/value3"

In case the value2 of the id2 is null,
the URL is like
"www.your-site.com/class/function/id1/value1/id2//id3/value3"

in the CI URL segment method, I think, it's important to the sequence order of the parameter value to get the value of the id?

How can I get the value of the certain id if the order of the id?
==> Original : "www.your-site.com/class/function/id1/value1/id2/value2/id3/value3"
--> Changed : "www.your-site.com/class/function/id1/value1/id3/value3/id2/value2/"

==> Should I track the order of the id to get the correct value? and how?
#2

[eluser]wiredesignz[/eluser]
You are making life very complicated for yourself. Is there a reason not to allow query_strings, or use $_POST?
#3

[eluser]OneCorea[/eluser]
Thanks a lot wiredesignz!!!

Well, how can I get a query string value in the URL when the sequence order of the id and value vary?

Such CI class library like '$this->uri->segment(n);',
$this->uri->uri_to_assoc(n, $uri_key);, I must set the $uri_key;

Is there some method to get the URL value in the URI address, which its URL parameter value vary?




Theme © iAndrew 2016 - Forum software by © MyBB