4
Contributors
11
Replies
17
Views
4 Years
Discussion Span
Last Post by pritaeas
0

is this the correct way the encode a browser url:

<script>
    function test()
    {

        $string= 'http://www.google.com';
        urlencode($string);
    }
</script>

Basically i have a website and i want to encode the url when it it shown in the browser.

Edited by DamzWildfire

0

No, you are mixing Javascript and PHP, not possible.

I think you misunderstand what URL encoding is. You can encrypt parts of an URL, but not the complete one. It's better if you explain WHY you want to do this.

0

basically i want to encode parts of the url when shown in the browser eg. mydomain.com/index.php. i wouldnt want the index.php to show. want use it as a means of security

0

With htaccess you can process all these with a single script, and do the decryption and redirect there. Am lost as to WHY you would want this.

0

Am not sure WHAT you are trying to secure. Just "securing" some URL parameters doesn't sound like a plan. If you are using sensitive data, use POST, and SSL.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.