Leppy Posted December 10, 2007 Share Posted December 10, 2007 Hello, I use the following code to encode my URLs on my site: urlencode(base64_encode("blah blah blah")); Which results in someting like this: YmxhaCBibGFoIGJsYWg And then I put a link on my site using this code <a href="/script/YmxhaCBibGFoIGJsYWg/">Click me</a> It works fine. Although to make a long story short, I added, inside the script who handles the URL, a debug function to let me know if the code "YmxhaCBibGFoIGJsYWg" exist in the DB or not. If it doesn't it sends me an e-mail with the user's browser and requested URL. I've been getting emails lately and I'm clueless about what might be the problem. It is mostly the following User Agent: Java/1.6.0 and sometimes: Microsoft URL Control - 6.00.8862 The requested URL by both browsers is: /script/ymxhacbibgfoigjsywg/ It looks like they are not taking the capital letters in the URL. It is a bug in the browser or it is a bug in my script/URL ? If it is a bug in the browser, is there a way I could use only non-capitalized letters with base64 or an alternative of base64? Any would be appreciated! Thank you, Leppy- Quote Link to comment Share on other sites More sharing options...
rarebit Posted December 10, 2007 Share Posted December 10, 2007 urlencode(strtolower(base64_encode("blah blah blah"))); or do an insensitive comparison? Quote Link to comment Share on other sites More sharing options...
Leppy Posted December 11, 2007 Author Share Posted December 11, 2007 That might work, although I'm not sure how I will be able to decode the string to find "blah blah blah" if the base64 is strtolower. Any idea? Quote Link to comment Share on other sites More sharing options...
Leppy Posted December 11, 2007 Author Share Posted December 11, 2007 or do an insensitive comparison? How do I do that? Could you link me to a php reference, I could read more about it. Quote Link to comment Share on other sites More sharing options...
noon Posted December 11, 2007 Share Posted December 11, 2007 He's just saying to check the base64 url against the db with strtolower on both. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.