|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
How can we stop someone from linking directly to your images?
Hello.
Can we stop someone from linking directly to your images? Like php, some perl code or something, so that it can only be done on the root server [linking to that image] and not from another server [or site]? Thanks. |
|
#2
|
||||
|
||||
|
If you're using Apache, you could find things like this to be useful -> http://forums.devshed.com/showthrea...4331&forumid=15
//NoXcuz
__________________
UN*X is sexy! who | grep -i blonde | date; cd ~; unzip; touch; strip; finger; mount; gasp; yes; uptime; umount; sleep |
|
#3
|
||||
|
||||
|
Every so often, you can rename your images with a randomly generated name, and keep a text file listing the 'real' name with the generated name.
## File format: [real name] [generated name] img1.gif 34reffdsf4k.gif img2.gif dfdfdr4f4fa.gif img3.gif 3fsdfe4wf4k.gif img4.gif 343ffddk.gif ## for example, 1) every 30 mins or so, run the function that renames your files and writes the file that maps the real name to the random name. 2) to get the actual file name, create a function like: PHP Code:
that would take "realname.gif", find it in mapFile.txt, and return the associated dynamically created name, and thus give you the file for that moment in time. Now, if you are talking about how to make sure your images are not copied via the browser, that is a browser issue. There are also ways you can dynamically water mark your images. Brett |
|
#4
|
|||
|
|||
|
You could always choose the easy option and code as a flash movie!
|
|
#5
|
||||
|
||||
|
Quote:
Bad idea... Flash is good but it doesn't make do you good building entire sites with it. It's not very user friendly...
__________________
-- Tomi Kaistila -- Developer's Journal The more you learn, the more you know. The more you know, the more you forget. The more you forget, the less you know. |
|
#6
|
||||
|
||||
|
It's a tad drastic but you could always keep a copy of the original file somewhere and use php to copy that file to the servers tmp directory with a temporary filename. Look at the manual for string tempnam (string dir, string prefix) under filesystem functions. Then all you do is put a PHP variable in the img src. By the time anyone links to the files they should have been deleted.
|
|
#7
|
||||
|
||||
|
I actually find the method estrabd explained to be the best. It's simple and flexible.
|
![]() |
| Viewing: Dev Shed Forums > Other > Beginner Programming > How can we stop someone from linking directly to your images? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|