Website url encode
hey i want to encode my website url as a form of security but i have no idea how to go about doing so and help?
Related Article: Write current url in an iframe by javascript
is a JavaScript / DHTML / AJAX discussion thread by rakibtg that has 2 replies, was last updated 9 months ago and has been tagged with the keywords: javascript, html, iframe.
DamzWildfire
Junior Poster in Training
51 posts since Jan 2013
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0
add this code within a javascript function?
DamzWildfire
Junior Poster in Training
51 posts since Jan 2013
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0
I'm unsure as to the use here. Could you give an example of what you're trying to accomplish?
diafol
Keep Smiling
10,634 posts since Oct 2006
Reputation Points: 1,628
Solved Threads: 1,506
Skill Endorsements: 57
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.
DamzWildfire
Junior Poster in Training
51 posts since Jan 2013
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 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.
pritaeas
Posting Prodigy
9,265 posts since Jul 2006
Reputation Points: 1,173
Solved Threads: 1,456
Skill Endorsements: 86
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
DamzWildfire
Junior Poster in Training
51 posts since Jan 2013
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0
Can you give an example of what you DO want to show, and how it should be processed?
pritaeas
Posting Prodigy
9,265 posts since Jul 2006
Reputation Points: 1,173
Solved Threads: 1,456
Skill Endorsements: 86
DamzWildfire
Junior Poster in Training
51 posts since Jan 2013
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 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.
pritaeas
Posting Prodigy
9,265 posts since Jul 2006
Reputation Points: 1,173
Solved Threads: 1,456
Skill Endorsements: 86
DamzWildfire
Junior Poster in Training
51 posts since Jan 2013
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 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.
pritaeas
Posting Prodigy
9,265 posts since Jul 2006
Reputation Points: 1,173
Solved Threads: 1,456
Skill Endorsements: 86