Masking URL parameters
<p>I often want to redirect the user or email them a link but I want to mask the parameters in the URL so they can't tell what extra information is being sent.</p>

<p>For example, if I want to present a link to <a href="http://www.example.com/directory/" rel="nofollow">http://www.example.com/directory/</a> but I also want to pass extra parameters of an email address and a hash for someone:</p>

<p><strong>Email:</strong> someone@example.com</p>

<p><strong>Hash:</strong> 22sd359d5823ddg4653dfgfFSG2</p>

<p>I can send them to this link, but I don't want them to see the parameters:</p>

<p><a href="http://www.example.com/directory/someone%40example.com/22sd359d5823ddg4653dfgfFSG2" rel="nofollow">http://www.example.com/directory/someone%40example.com/22sd359d5823ddg4653dfgfFSG2</a></p>

<p>So my first thought is just to <code>base64_encode()</code> it, but then you get those stupid == symbols at the end for the extra bytes. And also base64 encoding also generates quite long strings.</p>

<p><strong>Is there an easier, URL-friendly way to encode a string to hide its contents?</strong></p>

<p><strong>How would you normally do this? Is base64_encode() a standard practice?</strong></p>
