Troubles with query strings - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Troubles with query strings (/showthread.php?tid=34746) |
Troubles with query strings - El Forum - 10-08-2010 [eluser]Zeff[/eluser] Hi all, I'm trying to redirect to another controller method and I'm giving the reffering url as an url encoded parameter: eg: /login/index/?ref=http:/2Fwww.myserver.com/index.php/administration/overview/secret But on http://www.myserver.com/index.php/login/index/?ref=http:/2Fwww.myserver.com/index.php/administration/overview/secret I'm getting a 404... I also tried to get it as extra segment with index($ref){} method in the login controller, but it gives also a 404. BTW: Query string are enabled in config! Help please... Thanks! Troubles with query strings - El Forum - 10-08-2010 [eluser]jrtashjian[/eluser] Use an ampersand '&' instead of a question mark '?'. Your URL should look like this: http://www.myserver.com/index.php/login/index/&ref=http://www.myserver.com/index.php/administration/overview/secret Troubles with query strings - El Forum - 10-08-2010 [eluser]Zeff[/eluser] Normally query strings are started with a question mark? e.g. program?query_string&other;_q_string But I tried your solution but it doesn't help... Thanks anyway. Troubles with query strings - El Forum - 10-08-2010 [eluser]Dennis Rasmussen[/eluser] [quote author="Zeff" date="1286552132"]Normally query strings are started with a question mark? e.g. program?query_string&other;_q_string But I tried your solution but it doesn't help... Thanks anyway.[/quote] That is true, but with your URL you have your first question mark hidden. Your URL: http://www.myserver.com/index.php/login/index/?ref=http:/2Fwww.myserver.com/index.php/administration/overview/secret The first question mark is hidden after index.php: http://www.myserver.com/index.php?/login/index/?ref=http:/2Fwww.myserver.com/index.php/administration/overview/secret So you are basically adding 2 question marks to your URL. |