![]() |
problem with encode - 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: problem with encode (/showthread.php?tid=5011) |
problem with encode - El Forum - 12-31-2007 [eluser]Sawariya[/eluser] Hi Friends i am passing encoded data through URL.But encoded result produsing '==' at the end of encoded so getting an error like The URI you submitted has disallowed characters. this is my code <a href="<?=site_url().'test/view/'.$this->encrypt->encode($row->user_id);?>"><?=$row->display_name;?></a> anybody can help me problem with encode - El Forum - 12-31-2007 [eluser]Sawariya[/eluser] Friends any body have solution for this... problem with encode - El Forum - 01-03-2008 [eluser]Chris Newton[/eluser] You could just add = to the list of allowed characters in the URI string. I believe that's an option in the config file. It might be better to just POST the data though, rather than passing it as an argument. problem with encode - El Forum - 01-03-2008 [eluser]Sawariya[/eluser] yah you are correct already i changed in config file.. it was working... but i think that is not a correct solution.. i think your second suggestion is good. any other option for this problem?? thanks for your reply problem with encode - El Forum - 02-07-2008 [eluser]Sawariya[/eluser] But i am using href... so how can i pass those encoded data??.. i dont want to show it in url.. thanks in advance problem with encode - El Forum - 02-07-2008 [eluser]adamp1[/eluser] I had the same kind of problem with the encode function. Sadly I too didnt find a good solution. I don't know why it encodes the string and puts a == on the end. Well a little solution could be since you know it always has a == on the end, remove it, and add it on late? I know its note nice but it could work. problem with encode - El Forum - 02-07-2008 [eluser]Edemilson Lima[/eluser] Change Code: <a href="<?=site_url().'test/view/'.$this->encrypt->encode($row->user_id);?>"><?=$row->display_name;?></a> To: Code: <form action="<?=site_url().'test/view/'?>" method="post" style="margin:0px; float:left"> This will show a button instead of a link. You can change the layout of the submit button adding an inline CSS if you don't want a button there. At your "/test/view" controller you will need to get the $this->input->post('user_id') instead of the segment or the parameter passed to the function. Remember that after submiting a form using post, the back button will not work as before. The style="margin:0px; float:left" at the form tag is to make it fit in the page like a link. May you need to change this. problem with encode - El Forum - 02-07-2008 [eluser]Sawariya[/eluser] Hi Edemilson Lima Both are correct... but i am using href... i already explained my problem... i cant change allowed charecter in config wat is the solution for this.... thanks for repy problem with encode - El Forum - 02-08-2008 [eluser]Edemilson Lima[/eluser] I still not understand. Don't you can change the config at "system/application/config/config.php"? I think you just need to open it and add the char "=" to the allowed characters: Code: $config['permitted_uri_chars'] = 'a-z 0-9~%.:_=-'; Remember to always put the minus "-" at the end of the string, if you want to allow it in your URIs. If you put it before (for example: "_-="), the regular expression will consider the characters from "_" to "=" in the ASCII table. |