-2

Here is my url:

http://localhost/store/index.php/validate_email?id=K73/N7gAtqElUW0GQQ6lhelTSHIoKiP/JrTbxX0XZNgw8VKuib5fr1Y2zjRj4iB38s2iVXssuF+PbEA+swwyfA==&code=f3BHyZTAeZzv+++fK5AWSdsNMKjfyAJAzyMzVHucc/WMYtWPK8hR3cDRdOD+NKByUl6mcgYDVeKWFgjYwuObpzpQ==

Now when I get parameters using $_GET then it excludes all + sign.

 Array ( [id] => K73/N7gAtqElUW0GQQ6lhelTSHIoKiP/JrTbxX0XZNgw8VKuib5fr1Y2zjRj4iB38s2iVXssuF PbEA swwyfA== [code] => f3BHyZTAeZzv fK5AWSdsNMKjfyAJAzyMzVHucc/WMYtWPK8hR3cDRdOD NKByUl6mcgYDVeKWFgjYwuObpzpQ== ) 

My ID in URL is:

K73/N7gAtqElUW0GQQ6lhelTSHIoKiP/JrTbxX0XZNgw8VKuib5fr1Y2zjRj4iB38s2iVXssuF+PbEA+swwyfA==

But what I am getting is:

K73/N7gAtqElUW0GQQ6lhelTSHIoKiP/JrTbxX0XZNgw8VKuib5fr1Y2zjRj4iB38s2iVXssuF PbEA swwyfA== (no + symbol)

same case for code.

Milan Chheda
  • 8,159
  • 3
  • 20
  • 35

2 Answers2

2

From the PHP Manual:

The superglobals $_GET and $_REQUEST are already decoded.

Still, if you want as the URL, urlencode manually:

echo urlencode($_GET['id']);

This gives:

K73%2FN7gAtqElUW0GQQ6lhelTSHIoKiP%2FJrTbxX0XZNgw8VKuib5fr1Y2zjRj4iB38s2iVXssuF+PbEA+swwyfA%3D%3D
Thamilhan
  • 13,040
  • 5
  • 37
  • 59
0

Use %2B instead of +. I've tested.

Tiefan Ju
  • 510
  • 3
  • 14