Welcome Guest, Not a member yet? Register   Sign In
Moving away from $_GET (and querystrings)
#6

[eluser]TheFuzzy0ne[/eluser]
[quote author="gh0st" date="1234196729"]I understand that you can use $this->uri->uri_to_assoc() to get a URL, but what happens:

1) When the user types in "A really long phrase" -- you get:
http://www.example.com/search/term/a really long phrase
[/quote]

No, a browser will automatically encode the url. Try typing it into your own address bar and hitting enter. I get http://www.example.com/search/term/a% 20really% 20long% 20phrase (without the spaces). In some cases you won't see the encoding, but it is encoded nonetheless.

[quote author="gh0st" date="1234196729"]
2) How do you put the search phrase into the uri_to_assoc in the first place?
[/quote]

Usually using a redirect. One page gets the users input, then that page will reformat the input (if needed), and redirect the user to the search page which actually performs the search and displays the results.

[quote author="gh0st" date="1234196729"]
I tried $this->uri->assoc_to_uri() but if the user enters "A really long phrase" you get the result shown in part 1.[/quote]


Messages In This Thread
Moving away from $_GET (and querystrings) - by El Forum - 02-04-2009, 02:52 PM
Moving away from $_GET (and querystrings) - by El Forum - 02-04-2009, 04:38 PM
Moving away from $_GET (and querystrings) - by El Forum - 02-04-2009, 04:52 PM
Moving away from $_GET (and querystrings) - by El Forum - 02-04-2009, 05:04 PM
Moving away from $_GET (and querystrings) - by El Forum - 02-09-2009, 04:25 AM
Moving away from $_GET (and querystrings) - by El Forum - 02-09-2009, 04:57 AM



Theme © iAndrew 2016 - Forum software by © MyBB