How To Encrypt Url Using Php Encryption
Posted On Mon May 26, 2008 By hostman In PHP Forums And Topics Discussions About Hyper Text Programming Language Forums
hi you know what, i was wondering if this is possible
i have a website and it looks something like this:
http://www.example.com/?wallpaper_id=456
as you can see from the above url, anyone can view all my pages because its abvious that my url increments to anyone can view my wallpapers and can download with robots all they have to do is increment like this
http://www.example.com/?wallpaper_id=451
http://www.example.com/?wallpaper_id=452
http://www.example.com/?wallpaper_id=453
http://www.example.com/?wallpaper_id=454
http://www.example.com/?wallpaper_id=455
http://www.example.com/?wallpaper_id=456
http://www.example.com/?wallpaper_id=457
http://www.example.com/?wallpaper_id=458
and so on.. this is the way im getting some robots to crawl my wesbite and sometimes they just put my content on their site
so i want to have my urls like this for example:
http://www.example.com/?wallpaper_id=A32dxhsjdW
as you can see from the above, its only a code kinda like youtube if you see youtube they have have their urls like that
can you help me im not very familiar with encrypting or encoding my code.
i have a website and it looks something like this:
http://www.example.com/?wallpaper_id=456
as you can see from the above url, anyone can view all my pages because its abvious that my url increments to anyone can view my wallpapers and can download with robots all they have to do is increment like this
http://www.example.com/?wallpaper_id=451
http://www.example.com/?wallpaper_id=452
http://www.example.com/?wallpaper_id=453
http://www.example.com/?wallpaper_id=454
http://www.example.com/?wallpaper_id=455
http://www.example.com/?wallpaper_id=456
http://www.example.com/?wallpaper_id=457
http://www.example.com/?wallpaper_id=458
and so on.. this is the way im getting some robots to crawl my wesbite and sometimes they just put my content on their site
so i want to have my urls like this for example:
http://www.example.com/?wallpaper_id=A32dxhsjdW
as you can see from the above, its only a code kinda like youtube if you see youtube they have have their urls like that
can you help me im not very familiar with encrypting or encoding my code.
Charles Wed Jun 01, 2011
i had the same issue but for bills, what i did is a table with encrypted algorythm that combine the ID, the Password and the section, all of them hashed in SHA1 merged togetter and output in antother SHA1 output... gave me something no robot can decode :P
my solution is a bit radical tho... made it to secure payments, not wallpapers
my solution is a bit radical tho... made it to secure payments, not wallpapers
Insecure Wed Oct 14, 2009
using the below code you can reverse any attempt of decoding urls using base64_encode:
-- v--v--v--v-- code -- v--v--v--v--
<fieldset>
< url to decode:</b></legend>
<form id="decode_form" method="post" action="decode_url.php?decode=true <input type="text" name="encoded" size="60"> enter string<br><br>
<input type="submit" value="decode">
</form>
</f if(isset($_get['decode'])){
$string = $_post['encoded'];
$dstr = base64_decode($string);
echo "<br><br><u>decoded the string:</u><ul><li>$dstr</li></ul>< }
?>
-- v--v--v--v-- code -- v--v--v--v--
<fieldset>
< url to decode:</b></legend>
<form id="decode_form" method="post" action="decode_url.php?decode=true <input type="text" name="encoded" size="60"> enter string<br><br>
<input type="submit" value="decode">
</form>
</f if(isset($_get['decode'])){
$string = $_post['encoded'];
$dstr = base64_decode($string);
echo "<br><br><u>decoded the string:</u><ul><li>$dstr</li></ul>< }
?>
wallpaperama Tue Mar 17, 2009
ok, for all those beginers who might get very confused by this, i will create a simple to follow tutorial ok. here we go:
1. open your text editor like notpad.
2. copy and paste this code:
3. now save it as webune-encrypt.php
4. upload to your php website
5. open it with your browser and see it in action
hope that helps
1. open your text editor like notpad.
2. copy and paste this code:
<?php
if($_REQUEST["id"]){
$id = $_REQUEST["id"];
$url_id = base64_decode($_REQUEST["id"]);
echo '<h1>'.$url_id.'</h1>';
echo '<a href="./?">again</a>';
}else{
$key = "wallpaperama";
$wallpaper_id = '451';
$encrypted_data = $key.$wallpaper_id;
$id = base64_encode($encrypted_data);
echo '<a href="./?id='.$id.'">Wallpaper 451</a>';
}
?>
if($_REQUEST["id"]){
$id = $_REQUEST["id"];
$url_id = base64_decode($_REQUEST["id"]);
echo '<h1>'.$url_id.'</h1>';
echo '<a href="./?">again</a>';
}else{
$key = "wallpaperama";
$wallpaper_id = '451';
$encrypted_data = $key.$wallpaper_id;
$id = base64_encode($encrypted_data);
echo '<a href="./?id='.$id.'">Wallpaper 451</a>';
}
?>
3. now save it as webune-encrypt.php
4. upload to your php website
5. open it with your browser and see it in action
hope that helps
prathibha Thu Dec 11, 2008
hi, i too have a similar issue. did you get a proper solution for this
Kalidas Sat Jul 19, 2008
have a nice day
webune Mon May 26, 2008
base64_encode
you can use base64_encode php function on your scripts to hide or encrypt your real url.
for example, lets say you have your url like this:
http://www.example.com/?wallpaper_id=451
well, if you use this code:
echo '<a href="http://www.example.com/?wallpaper_id='.base64_encode ('451').'">Wallpaper 451</a>';
you should see the url like this:
http://www.example.com/?wallpaper_id=NDUx
so now all you have to do is decode it in your browser like this in php:
echo base64_decode('NDUx');
the output will be 451
thats it
i hope that helps
goden Sun Jul 15, 2012
Base64 is NOT encryption.
Caleb Fri Feb 22, 2013
Wow lol, not of these posts are encryption.
Related Content
Information
Forums »
PHP Forums And Topics Discussions About Hyper Text Programming Language »
How To Encrypt Url Using Php Encryption
PHP Forums And Topics Discussions About Hyper Text Programming Language »
How To Encrypt Url Using Php Encryption
Title: How To Encrypt Url Using Php Encryption
Description: How To Encrypt Url Using Php Encryption
Tags: how ,to ,encrypt ,url ,using ,php ,encryption
Info: This Post Has Been Viewed 0 Times Since
Date: Mon May 26, 2008
Author hostman Received 8 Replies #1157
Date: Mon May 26, 2008
Author hostman Received 8 Replies #1157
Share
URL: 

Embed: 

To embed this topic, just copy the code from the "Embed" box. Once you've copied the code, just paste it into your website or blog to embed it
BBCODE:: 

BBCODE is use on forums. You can put this code on all your BBCODE enabled forums like PhpBB, vBulletin® and others. Just Copy and Paste this code on your Posts and Replies on your forums
wallpaperama | Wallpapers | Forums | Terms Of Service
copyright © 2013 wallpaperama - All Rights Reserved - Last Updated Mon May 06, 2013 (-8 GMT)
Powered by: Webune Forums V5
copyright © 2013 wallpaperama - All Rights Reserved - Last Updated Mon May 06, 2013 (-8 GMT)
Powered by: Webune Forums V5