Dynadot .com Transfer Sale โ€” only $10.49, coupon COMSUMMER26

PHP picture and URL grabbing question

SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
NamecheapNamecheap
Watch

bluenoser

Established Member
Impact
2
I have a picture that I want people to use via hotlinking, however I don't want them to know the direct path so I have written a script that will output it.
so the URL to teh pic is mysite.com/pic.php

Now I want to do something more, I want to log the URL of the sites that are grabbing the pic. Is there any code that I can use to do this? I am on a shared server if it makes a difference.

Thanks
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
$_SERVER['HTTP_REFERER'] contains the data you are after, be sure to check and make sure it looks valid before inputting it into a database in case it is spoofed tho.

Also be aware that some firewalls block it so it may end up being blank.
 
0
•••
filth@flexiwebhost said:
$_SERVER['HTTP_REFERER'] contains the data you are after, be sure to check and make sure it looks valid before inputting it into a database in case it is spoofed tho.

Also be aware that some firewalls block it so it may end up being blank.
Great thanks,

That is what I was going to use, but I wasn't suere if it was the right thing,, or at least the best way
 
0
•••
it may also be best for you to change the extension of the file to the extension the image should be and use a htaccess file to make it so that file is parsed by the php engine. It will not be so noticeable then that you are using a script and people wont try circumventing it.
 
Last edited:
0
•••
filth@flexiwebhost said:
it may also be best for you to change the extension of the file to the extension the image should be and use a htaccess file to make it so that file is parsed by the php engine. It will not be so noticeable then that you are using a script and people wont try circumventing it.
Good point. That's when the abuse starts to come about. :td:

-Steve
 
0
•••
That is a good idea. Right now I am in the testing stage for my script. I will definetly add that to the list of things to do. It is a rather easy thing to make work.
 
0
•••
Olitt โ€” high-converting AI websites, only from $1/moOlitt โ€” high-converting AI websites, only from $1/mo
Escrow.com
Spaceship
Domain Recover
CryptoExchange.com
Catchy
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back