![]() |
pass a variable to controller (with nonenglish characters) - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: pass a variable to controller (with nonenglish characters) (/showthread.php?tid=5966) |
pass a variable to controller (with nonenglish characters) - El Forum - 02-10-2008 [eluser]chejnik[/eluser] Hello, I would like to pass some variables to controller, but they contain nonEnglish characters (like æ,ð) from Icelandic alphabet. First I make search query and I make list of headwords. Clicking on headword I would like to make detail view of headword with format. So I have to pass the headword and his number. Code: if($query->num_rows()>0){ I am not sure if I do it correctly, but I make hyperlink. The last to items in segments array are variables, right? Thank you for help and the CodeIgniter. Ales pass a variable to controller (with nonenglish characters) - El Forum - 02-10-2008 [eluser]Edemilson Lima[/eluser] You must urlencode() a string with non-ASCII characters before pass it by the URI. Also you must allow the characters generated by urlencode() in your config file. pass a variable to controller (with nonenglish characters) - El Forum - 02-10-2008 [eluser]chejnik[/eluser] Hello, thank you. I have encoded the url with urlencode - the result is here Code: ..search/showHeadword/sei n % C 3 % B E roska/0 Code: $string1 = urlencode($item["keyword"]); But when I click on the link / this message shows - The URI you submitted has disallowed characters. Thank you Ales pass a variable to controller (with nonenglish characters) - El Forum - 02-10-2008 [eluser]Edemilson Lima[/eluser] Open your config file at "system/application/config" folder and allow any extra characters not yet allowed in the regular expression: Code: $config['permitted_uri_chars'] = 'a-z 0-9~%.:_-'; |