Welcome Guest, Not a member yet? Register   Sign In
How to pass encrypt GET variable

Hi, guys
I'm development some kind of register confirm.

URL likes
was sended to user by email.

character likes A2AAb1+0W1Vbw was username encrypted by CI's encrypt library.

But I got "/" or "+" in ciphertext occasionally, AND those
characters is illegal in URL.

Any idea?
I'll waitting online

I found ~ _ - was in $config['permitted_uri_chars']
and illegal characters is + = /
so we can str_replace + = / with ~ _ -

Couldn't you just use the PHP urlencode() function? If you used this when creating the email containing the URL, it should escape any of the characters causing you problems. Then just use the urldecode() function when you process and unencrypt the string.

urlencode will bring in % which is also illegal charactor in CI config

You should use sthing like :

and send :
http://mysite/controller/model/$key as url

You don't have to use the encrypt helper (at least not in the goal of being able to decrypt the key for knowing the user).
Just create a waitforconfirm table with at least 2 fields : a username field and a "password" field.

You will know your user using a query that looks like : "select * from waitforconfirm where password=$key"

This link might help :

[eluser]Derek Allard[/eluser]
What about
$random_passkey = random_string('alnum', 13);

Theme © iAndrew 2016 - Forum software by © MyBB