I need to encode an url in javascript and decode it in php.. how can I do this? I tried using encodeURI and encodeURIComponent functions with urldecode in php but it doesnt work...
Tell me more
×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
|
Encoding URLs in Javascript should work fine with encodeURI(). See here: How to encode a URL in Javascript? In PHP, if the URL you're reading is being passed through a GET parameter, there's no need to decode it. It's already been done. Otherwise, urldecode() is your answer. You're gonna need to post more info if you need more help. | |||||
|