| |
|
Welcome to KnowledgeSutra - Dear Guest | |
How To: Hide The Real Url Of Your Images
Started by electriic ink, Jul 14 2005 06:30 PM
29 replies to this topic
#22
Posted 01 October 2005 - 09:57 AM
what might be good is a page where we can see this scipt in use. i mean does this also prenevnt people for right clicking the image and then pressing View Image? how would that show in the url box in a browser. Maybe it will show diffrently for diffrent browsers. sorry for being so critical but other than that nice script.
#23
Posted 01 October 2005 - 12:24 PM
The script is currently in use on my website. Right click and do view image on the any of the images on the website and (in firefox I know that) you may be surprised 
In the browser, when you do view image, the url will be http;//example.com/img.php?fl=IMAGE&type=2 etc. On my example website, you'll see that I edited the variables in the url.
The cache question however I am unsure about.
If you wish to get image protection, here is a small script I will provide for you:
[hr=noshade][/hr]
Place this on whatever php enabled webpage you want to allow images to be displayed (note it maybe a good idea to alter the contents of the variable):
Just before this line:
on img.php add this:
After this line:
add this:
I'm not sure if this works but try it. I doubt though that it will protect right click, save as. What I do think it'll protect is:
Note: This script has not been tested but I am 99.99% sure it'll work, please make backup copies of your files first.
In the browser, when you do view image, the url will be http;//example.com/img.php?fl=IMAGE&type=2 etc. On my example website, you'll see that I edited the variables in the url.
The cache question however I am unsure about.
If you wish to get image protection, here is a small script I will provide for you:
[hr=noshade][/hr]
Place this on whatever php enabled webpage you want to allow images to be displayed (note it maybe a good idea to alter the contents of the variable):
<? $allowImage = "1a2b3c4d"; ?>
Just before this line:
Quote
/* Firstly let's see if the variables have information in them */
on img.php add this:
if ($allowImage == "1a2b3c4d") {
After this line:
Quote
include $img . $filename . "." . $ext;
add this:
} else {
echo " <script> window.alert (\"This image has been protected. You are NOT ALLOWED to see it when attempting to get to it directly.\"); </script>";
}
I'm not sure if this works but try it. I doubt though that it will protect right click, save as. What I do think it'll protect is:
- Image Hotlinking
- Accessing images directly
Note: This script has not been tested but I am 99.99% sure it'll work, please make backup copies of your files first.
#24
Posted 01 October 2005 - 06:20 PM
cmatcmextra, on Oct 1 2005, 06:24 AM, said:
The script is currently in use on my website. Right click and do view image on the any of the images on the website and (in firefox I know that) you may be surprised 
In the browser, when you do view image, the url will be http;//example.com/img.php?fl=IMAGE&type=2 etc. On my example website, you'll see that I edited the variables in the url.
The cache question however I am unsure about.
If you wish to get image protection, here is a small script I will provide for you:
[hr=noshade][/hr]
Place this on whatever php enabled webpage you want to allow images to be displayed (note it maybe a good idea to alter the contents of the variable):
Just before this line:
on img.php add this:
After this line:
add this:
I'm not sure if this works but try it. I doubt though that it will protect right click, save as. What I do think it'll protect is:
Note: This script has not been tested but I am 99.99% sure it'll work, please make backup copies of your files first.
In the browser, when you do view image, the url will be http;//example.com/img.php?fl=IMAGE&type=2 etc. On my example website, you'll see that I edited the variables in the url.
The cache question however I am unsure about.
If you wish to get image protection, here is a small script I will provide for you:
[hr=noshade][/hr]
Place this on whatever php enabled webpage you want to allow images to be displayed (note it maybe a good idea to alter the contents of the variable):
<? $allowImage = "1a2b3c4d"; ?>
Just before this line:
on img.php add this:
if ($allowImage == "1a2b3c4d") {
After this line:
add this:
} else {
echo " <script> window.alert (\"This image has been protected. You are NOT ALLOWED to see it when attempting to get to it directly.\"); </script>";
}
I'm not sure if this works but try it. I doubt though that it will protect right click, save as. What I do think it'll protect is:
- Image Hotlinking
- Accessing images directly
Note: This script has not been tested but I am 99.99% sure it'll work, please make backup copies of your files first.
To prevent people from taking images by using right-click, just put in a disable right-click script. It comes in useful in some situations but you are never going to be able to totally protect your images. If I really wanted an image, i could just take a screenshot of the site and cut it out
I think its a really handy tool. I do this on my clan site but for the pages. I use a re.php to redirect the link to the correct page to mask what the actual page name is. There are ways around this too but it helps against noobs :\
xJedix
#25
Posted 01 October 2005 - 11:04 PM
Sorry, but I am not understanding the purpose of this script.
I will point some cons:
- People will still be able to hotlink to it - also, this will make usual hotlinking protection useless.
- About the cache thing, no, the browser will not cache the images, thus increasing your
bandwidth use.
- The other point is that it will make creating pages harder (you will have to write a longer address for img src)
- Scripts that rely on user input are EXTREMELY dangerous. For example, due to a huge design flaw
(if you give some ext like 934910841 it won't be concatenated to the file name; allowing a potential
hacker to inject code or see your files).
Now, some coding tips:
- I noticed unexperienced coding standards, especially indentation for the PHP code.
- Usually instead of using several if and elseif you can use switch
- Use $_GET instead of $_REQUEST
- Be careful with your error checking routine; check if the given ext actually exists.
- Instead of naming an ext an using switch/if else, you can use an array; for example:
$exts = array ('jpg', 'gif', 'bmp', 'png', 'tiff')
$exts[0] is jpg, $exts[1] is gif and so on.
- Learn about INTERPOLATION.
Strings using double quotes (") don't need to be concatenated.
- And finally, the most important: NEVER TRUST USER INPUT!!
Always filter it properly
I hope you don't take this as offense, but as constructive criticism.
I will point some cons:
- People will still be able to hotlink to it - also, this will make usual hotlinking protection useless.
- About the cache thing, no, the browser will not cache the images, thus increasing your
bandwidth use.
- The other point is that it will make creating pages harder (you will have to write a longer address for img src)
- Scripts that rely on user input are EXTREMELY dangerous. For example, due to a huge design flaw
(if you give some ext like 934910841 it won't be concatenated to the file name; allowing a potential
hacker to inject code or see your files).
Now, some coding tips:
- I noticed unexperienced coding standards, especially indentation for the PHP code.
- Usually instead of using several if and elseif you can use switch
- Use $_GET instead of $_REQUEST
- Be careful with your error checking routine; check if the given ext actually exists.
- Instead of naming an ext an using switch/if else, you can use an array; for example:
$exts = array ('jpg', 'gif', 'bmp', 'png', 'tiff')
$exts[0] is jpg, $exts[1] is gif and so on.
- Learn about INTERPOLATION.
Strings using double quotes (") don't need to be concatenated.
- And finally, the most important: NEVER TRUST USER INPUT!!
Always filter it properly
I hope you don't take this as offense, but as constructive criticism.
#27
Posted 02 November 2008 - 03:07 PM
That could be quite useful, however, the best thing to do, is to use hot link protection, any web hosting with cpanel can do this, (trap17 included) and set the URL of the hot link page to an image, then, if anyone uses an image from your site, using a URL of your site, the hot link image is displayed. That way, the site is advertising you site.
Using images without permission is illegal anyway if you haven't said otherwise, so people shouldn't do it.
Using images without permission is illegal anyway if you haven't said otherwise, so people shouldn't do it.
#28
Posted 07 November 2009 - 05:35 AM
Hide The Real Url Of Your ImagesHow To: Hide The Real Url Of Your Images
Hope this site would help anyone who needs to hide the image name and the path .This a great service and it helps people who dosen't have much web technology
Happy hiding!
-reply by chamara#29 Guest_Eric_*
Posted 12 September 2010 - 04:31 PM
Hi! everybody,
I have been trying to use this particular script but i get the following PHP error Parse error: syntax error, unexpected T_STRING in /home/a9844807/public_html/images/SharedImages/kaysInternet1.jpg on line 1
I'm quite kinda green to PHP. somebody should help me.Thanks!
I have been trying to use this particular script but i get the following PHP error Parse error: syntax error, unexpected T_STRING in /home/a9844807/public_html/images/SharedImages/kaysInternet1.jpg on line 1
I'm quite kinda green to PHP. somebody should help me.Thanks!
Reply to this topic

1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users














