passing text over the URI - how to encode? |
[eluser]deck42[/eluser]
Hi everyone, This is quite a basic question: if I want to pass long messages over the URI, I run into the problem that my browser will interpret some characters in a way that breaks the URI, i.e. I get a 404. So I guess I have to encode all URI text, but what algorithm to use? base64? urlencode? unix2unix? As far as I can say all generate some unwanted characters, which I would have to allow, but then the security suffers. I though this question is so fundamental that there must be some simpler solution that Im missing?
[eluser]John_Betong_002[/eluser]
Take a look at the User Guide, url_title();, it may do what you want...
[eluser]deck42[/eluser]
Hello and thanks for your reply! Yet I do not feel this is what Im looking for. Let me rephrase: I want to redirect from one controller to another and pass along a status message. I can only do this over the URI, since I cant call a controller directly. Now I dont want to worry about whats in the string I pass. There has to be some standard encode decode for this? is url_title that, will it encode / decode any forbidden characters?
[eluser]danmontgomery[/eluser]
Use session? Code: // controller 1
[eluser]CroNiX[/eluser]
http://us.php.net/manual/en/function.urlencode.php http://us.php.net/manual/en/function.urldecode.php
[eluser]deck42[/eluser]
Thanks alot for your replys. I remember trying urlencode and decode and having some special problem, but forgot what it was :-) Anyways, the session solution looks very neat, I will go with that, thanks to all! |
Welcome Guest, Not a member yet? Register Sign In |