when i load my controller i have this:
$this->load->library('encrypt');
$get = null;
parse_str($_SERVER['QUERY_STRING'],$get);
$email = $this->encrypt->decode($get["acc"]); // e.g. www.lol.com/?acc=troll
And my controller is called like this:
$this->load->library('encrypt');
$this->load->helper("url");
$user = $this->input->post('email', true);
$encrypted_string = $this->encrypt->encode($user);
redirect('account/viewaccount?acc='.$encrypted_string);
The url looks like this:
http://localhost/CodeIgniter/index.php/account/viewaccount?acc=+fgSAs6X7ysW6XDjFVw//9RGVbY751zZv1LQ44yYBjhVuzI1BC1t9BbZCIUdX5lpYA==
But the problem is, when i encode i get a value, but then later on, when i decode this huge value (I can receive this value flawless, by testing) it returns nothing, just NULL.
Why is this happening?
Thank You
Encoded form is not url safe, try using some other encoding technique or
urlencodethe output ofencode.