HOTLINKING HOTLINKING
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

HOTLINKING

Started by sigepjedi, June 17, 2004, 05:17:27 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sigepjedi

I have read all the posts on Hotlinking, and unfortunatly the .htaccess will not work for me on my windows box.

I have two primary pages that I am seeing is getting hit with Hotlinking:
1.) viewImage.php
     This was added as a mod for watermarking the image

2.) get_file.php
     

Both of these are being hotlinked, and I would like to do some http referer checking at the tops of these to prevent the hotlinking. I realize this isnt 100%, but its better than nothing. Im not too good with php, but code in coldfusion.

I basiclly want to check the referer at the top, and if its contained in a list of allowed sites, allow the page to continue processing as normal. If its not contained in the allow list of sites, then display a different image.

Thanks in advance.

Joachim Müller

what exactly is your question, you seem to know pretty well what you're doing. You'll need something likeif ($HTTP_REFERER == 'http://foo.com' || $HTTP_REFERER == 'http://bar.com') {
// here goes the regular code from the file
} else {
print 'You're a nasty boy, you mustn't hotlink my pages';
}


GauGau