url encode |
[eluser]Leonel Folmer[/eluser]
Hi all, I need a help to encode a url, how can I do this with CI? I'm trying to prevent a user from changing the profile of another, currently the url shows the user id at the end of a url like this: http://www.mydomain.com/area/change/1 Code: <?php echo anchor("area/change/".$user_id, 'Edit profile'); ?> Any help is welcome, thanks!
[eluser]vikascoollives[/eluser]
There is no need to encode the url , what you are supposed to do is : Check the session id or session username (or any unique parameter) you have insert in the session in every function in controller. So that one user can not access the other account anyhow .
[eluser]Leonel Folmer[/eluser]
[quote author="vikascoollives" date="1299588106"]There is no need to encode the url , what you are supposed to do is : Check the session id or session username (or any unique parameter) you have insert in the session in every function in controller. So that one user can not access the other account anyhow .[/quote] Thanks for your time, here is my controller: Code: function index()
[eluser]danmontgomery[/eluser]
You can check the ID they are trying to change against the ID of the user: Code: function change($id) {
[eluser]Leonel Folmer[/eluser]
[quote author="noctrum" date="1299629649"]You can check the ID they are trying to change against the ID of the user: Code: function change($id) { Exactly, simple and easy solution. thank you! |
Welcome Guest, Not a member yet? Register Sign In |