Adding a base64_encode data to URL |
[eluser]Josepzin[/eluser]
I want to create a URI with a encoded data, like this: Code: htt://domain.com/loquesea/VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw== But it is impossible, because when i get the segment, this is in lowercase and i can not decode it... I have read same discussion posts about the lowercase URIs and CI, my question is: is possible get a segment without lowercase? I do not want to modify the core... :S I think, the segment function may be a parameter to disconnect this lowercase conversion.
[eluser]Jan_1[/eluser]
May be just doing a step more with str_replace? http://de2.php.net/manual/en/function.str-replace.php
[eluser]Josepzin[/eluser]
May be replacing uppercases with 2 characters... Same like A -> _a, B -> _b ... :S
[eluser]Jan_1[/eluser]
yes, sorry, my bad english... Did you see this one: http://ellislab.com/forums/viewthread/45271/P15/ they do discuss it alike.
[eluser]aquariuz[/eluser]
Maybe this helps. I use this code to encode a URL if users are not logged in: Code: $uri_segments = substr(current_url(), strlen(base_url())); And this code to decode: Code: $redirect = unserialize(gzuncompress(stripslashes(base64_decode(strtr($redirect, '-_.', '+/=')))));
[eluser]Josepzin[/eluser]
@aquariuz: i like it, i will try it, thanks! @Jan from Hamburg: my english is really bad, i am Tarzan |
Welcome Guest, Not a member yet? Register Sign In |