Advanced search  

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

Pages: [1]   Go Down

Author Topic: HOTLINKING  (Read 4818 times)

0 Members and 1 Guest are viewing this topic.

sigepjedi

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 111
HOTLINKING
« on: June 17, 2004, 05:17:27 pm »

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.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: HOTLINKING
« Reply #1 on: June 20, 2004, 12:34:12 am »

what exactly is your question, you seem to know pretty well what you're doing. You'll need something like
Code: [Select]
if ($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
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 19 queries.