I wrote some code wherein email addresses are converted to base64_encode strings before getting sent in a query string, like this:
$email = 'john@apple.com';
$email = base64_encode($email);
$link = '<a href="mypage.php?e='.$email.'">link</a>';
That seemed fine to me, until I read, in the manual's base64_encode entry, a comment which said, "You'll want to call urlencode on the base_64 encoded data before putting it into a GET.* IIUC, base 64 output includes the plus and the slash, both of which will be mungered by browsers."
Now, the query strings that get generated by my code above never seem to create a "bad" query string: they get through to the processing page (and get processed) fine every time. I've tried it with scores of random email addresses, and they always get through, and I never see a "+" or a "/" in the encoded string.
Is this just chance, in which case I should still modify the code somehow? Or does it show that these characters are not in fact generated, and that I have nothing to worry about?
Furthermore, urlencoding the string does cause problems.
Hope this makes sense. Thanks!