INPUT CLASS destroys global get? |
[eluser]judico[/eluser]
noted and very true. I lean on regex's too much sometimes. (in my case I am usually only looking for one value) thanks
[eluser]RJ[/eluser]
[quote author="xwero" date="1239405316"]judico doing a preg_match for every value you have to get is more expensive than parsing the query string once and putting it in a variable, it doesn't have to be the get global.[/quote] You don't have an example of parsing the query string once do you? Thanks
[eluser]pistolPete[/eluser]
[quote author="bullspit" date="1239407178"]You don't have an example of parsing the query string once do you?[/quote] He posted it above: /forums/viewthread/111036/#560442
[eluser]judico[/eluser]
xwero for a get request something like http://www.example.com/sample?txt=foo&cat=bar the sample in cited in #7 Code: parse_str($_SERVER['QUERY_STRING'],$_GET); #from response #7 Array ( [/sample] => ) whereas something like this Code: $keys = explode('?', $_SERVER['REQUEST_URI']); yields Array ( [0] => txt=foo [1] => cat=bar ) is there something environmental like a config setting that makes your snippet yield something similar? what's the best practice here for this type of situation? thanks
[eluser]xwero[/eluser]
it's strange the server query string fetches a path segment? I used the snippet on different servers and i haven't had problems yet. The uri_protocol shouldn't be auto but i don't see how that could cause the problem as the server global is not related to CI.
[eluser]judico[/eluser]
ok xwero thanks for your reply. the emergent behavior has to do with url rewriting. http://www.example.com/index.php/sample?txt=foo&cat=bar #note the index.php is included on this one yields txt=foo&cat=bar using your method from response #7 I set up url rewrite with this http://codeigniter.com/wiki/mod_rewrite/ |
Welcome Guest, Not a member yet? Register Sign In |