![]() |
permitted_uri_chars and $_GET - 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: permitted_uri_chars and $_GET (/showthread.php?tid=6007) |
permitted_uri_chars and $_GET - El Forum - 02-11-2008 [eluser]ooskar[/eluser] hi, i have CI with default config. my question is: how can i use url like this http://www.mysite/controller/action/?val=1&val=2 now i see error "page not found" permitted_uri_chars and $_GET - El Forum - 02-11-2008 [eluser]Michael;[/eluser] Try this link: http://ellislab.com/codeigniter/user-guide/general/security.html permitted_uri_chars and $_GET - El Forum - 02-11-2008 [eluser]Edemilson Lima[/eluser] You can use segments or query strings, but not both, I think. To enable query strings, open your config/config.php and change this line to TRUE: Code: $config['enable_query_strings'] = FALSE; Code: www.yoursite.com/index.php?c=controler_name&m=function_name&other_var=value permitted_uri_chars and $_GET - El Forum - 02-12-2008 [eluser]ooskar[/eluser] but i need use standard controller and $_GET together. this http://www.mysite/controller/action/?val=1&val=2 and now i i add "?val=1" CI say "page not found" i tried add "?" to permitted_uri_chars but it doesnt works $config['permitted_uri_chars'] = 'a-z 0-9~%.:_-?&='; $config['enable_query_strings'] = FALSE; permitted_uri_chars and $_GET - El Forum - 02-12-2008 [eluser]Edemilson Lima[/eluser] Code: http://www.mysite/controller/action/?val=1&val=2 Code: http://www.mysite/controller/action/1/2 Code: class Test extendes Controller { Value 1 = 123 Value 2 = 456 As I said before, this way is more search engine friendly, more readable and more secure. permitted_uri_chars and $_GET - El Forum - 02-12-2008 [eluser]ooskar[/eluser] but i need use ?val=1 not as function's params but in javascript i need permit "?" in url i dont use $_GET parameters on my website i cant change js because it is from other company permitted_uri_chars and $_GET - El Forum - 02-12-2008 [eluser]Edemilson Lima[/eluser] Hmmmm... I don't know if it is possible to use URI segments and query strings together. You could enable the query strings ($config[’enable_query_strings’] = TRUE), but in this case you need to build your URLs as I said (www.yoursite.com/?c=controler_name&m=function_name&par1=value&par2=value). I think the regular expression below is wrong. If you want to alow the hifem "-" in your URI, you must put it in the end of the string. Code: $config[’permitted_uri_chars’] = ‘a-z 0-9~%.:_-?&=’; permitted_uri_chars and $_GET - El Forum - 02-12-2008 [eluser]ooskar[/eluser] so, how should look $config[’permitted_uri_chars’]? $config[’permitted_uri_chars’] = ‘?&=a-z 0-9~%.:_-’; doesnt work permitted_uri_chars and $_GET - El Forum - 02-12-2008 [eluser]Edemilson Lima[/eluser] Try this: Code: "a-z 0-9~%.:_\?&=-" permitted_uri_chars and $_GET - El Forum - 02-12-2008 [eluser]ooskar[/eluser] i try it yesterday but CI crashed. |