anti image theft script [Archive] - SpeedGuide.net Broadband Community

View Full Version : anti image theft script


Banshee
02-24-02, 10:25 PM
This guy did it with asp http://www.webcontrolcenter.com/forum/topic.asp?TOPIC_ID=1602&FORUM_ID=16&CAT_ID=2&Topic_Title=Off%2Dsite+JPEG+killer+in+%2ENet&Forum_Title=%2ENET+Forum

How can i do that with php?

I want it so when someone trys to see one of my pictures off site they will get one of those geocities type messages like:

"sorry, this image can only be viewed on www.whatever.com"

o yah, i'm a php n00b

4oh4
02-25-02, 01:46 PM
Php has environment variables, one of which is HTTP_REFERER. So you could do something like:

<?php
.....
.....
$yoursite="www.yoursite.com";
$referer_url=getenv('HTTP_REFERER');
if(strstr($referer_url,$yoursite) { //checks for the second string within the first
#then "www.yoursite.com" was in the domain name
#part of the refering url
} else {
#it wasn't
}
.....
.....
?>


That's not perfect or 'untrickable' by any means but it'll give you something to start with.


edit:
Damn, I just reread your question and I guess I didn't really answer the right question. I don't know about that "context.Response.ContentType" asp syntax, but to keep from serving up images with php I would think you could use an .htaccess file. If you want I can take a closer look and see what I can come up with and throw you an email.

Banshee
02-25-02, 03:41 PM
Originally posted by 4oh4



If you want I can take a closer look and see what I can come up with and throw you an email.

Yah, that would be great. Thanks :)

I really don't know too much yet, i just know the basics, thats about it. I just started messin with php a few weeks ago

4oh4
02-25-02, 05:17 PM
You've got mail.

Banshee
02-25-02, 06:16 PM
Originally posted by 4oh4
You've got mail.

i'm not recieving any mail on my isp e-mail AGAIN! #&$*^*&$@!

Could you send again to cpbanshee@excite.com