Welcome Guest, Not a member yet? Register   Sign In
Encrypt Class Problem
#1

[eluser]Deep Arora[/eluser]
I am using CI's encrypt library to encrypt a part of the URL.

Now after encrypting, I form the URL and email it to user. This is a URL that user can click to unsubscribe from the emails.

Now, after encryption, it adds "/" slash multiple times as part of its encryption. So the string outputs as:

Fa29uf1B4yPTKiy3EVMC4xhYMyVy2s1lMfNNK/PjnJgN2Vf0ivQxB5ZBVadyFf6QQt33Co6emVQduqGsv3vM6jndN5C08l7swKWrI/FEEH3nUMU3Tc0Zen3UauVkCaaa

As you can see there are THREE instances of / in the above string.

The URL becomes like this:

http://mydomain.com/process/remove/Fa29u...3UauVkCaaa

But when I rceeive this parameter in my REMOVE function i controller PROCESS, it receives the value only upto first instance of "/"

Only this part of string is received: Fa29uf1B4yPTKiy3EVMC4xhYMyVy2s1lMfNNK

How can I ensure that I receive FULL string to decrypt?

Regds,
Deep
#2

[eluser]Unknown[/eluser]
use $this->uri->total_segments()
and a loop using $this->uri->segment(n) to pull all the segments and reassemble them.

see Uri class for more info

or make it so there are no / in the encrypted string
#3

[eluser]Deep Arora[/eluser]
Is there a way to ensure that no / gets added to the encrypted string?
#4

[eluser]Zair[/eluser]
To avoid / issue you can use this

urlencode($this->encrypt->encode('abc'));

and at the other end you can decrypt it by using :

$this->encrypt->decode->(urldecode($this->uri->segment(3));

hope this will solve the issue... Smile
#5

[eluser]InsiteFX[/eluser]
string stripslashes ( string $str )

InsiteFX
#6

[eluser]chamil sanjeewa[/eluser]
thanx Zair
#7

[eluser]DM613[/eluser]
thanks for sharing it with us,we appreciate it very much ,you are so kindly,we will go on look your post ,welcome more new information from you ,thanks again.

I have the same opinion as you ,I think your words is reasonable and meaningful.
#8

[eluser]pooja[/eluser]
Hello....

Thank you for the answer.....

iphone Application development

pooja

KryptonSoft




Theme © iAndrew 2016 - Forum software by © MyBB