NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page PHP picture and URL grabbing question

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 06-26-2006, 10:02 AM THREAD STARTER               #1 (permalink)
NamePros Regular
Join Date: Aug 2005
Location: Canada
Posts: 455
bluenoser will become famous soon enoughbluenoser will become famous soon enough
 



Caution PHP picture and URL grabbing question


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
__________________
Webmaster Blog

Hoser News

Why I like RecieveLinks
bluenoser is offline  
Old 06-26-2006, 10:20 AM   #2 (permalink)
NamePros Expert
 
Peter's Avatar
Join Date: Nov 2003
Location: Scotland
Posts: 5,069
Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute
 


Child Abuse Save The Children Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
$_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.
Peter is offline  
Old 06-26-2006, 10:27 AM THREAD STARTER               #3 (permalink)
NamePros Regular
Join Date: Aug 2005
Location: Canada
Posts: 455
bluenoser will become famous soon enoughbluenoser will become famous soon enough
 



Originally Posted by filth@flexiwebhost
$_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.
????: NamePros.com http://www.namepros.com/programming/210908-php-picture-and-url-grabbing-question.html

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
__________________
Webmaster Blog

Hoser News

Why I like RecieveLinks
bluenoser is offline  
Old 06-26-2006, 10:34 AM   #4 (permalink)
NamePros Expert
 
Peter's Avatar
Join Date: Nov 2003
Location: Scotland
Posts: 5,069
Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute
 


Child Abuse Save The Children Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
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 by filth@flexiwebhost; 06-26-2006 at 10:40 AM.
Peter is offline  
Old 06-26-2006, 11:59 AM   #5 (permalink)
A Wealth of Knowledge
 
stscac's Avatar
Join Date: Aug 2004
Posts: 3,809
stscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud of
 



Originally Posted by filth@flexiwebhost
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.
????: NamePros.com http://www.namepros.com/showthread.php?t=210908

-Steve
stscac is offline  
Old 06-27-2006, 05:51 AM THREAD STARTER               #6 (permalink)
NamePros Regular
Join Date: Aug 2005
Location: Canada
Posts: 455
bluenoser will become famous soon enoughbluenoser will become famous soon enough
 



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.
__________________
Webmaster Blog

Hoser News

Why I like RecieveLinks
bluenoser is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 10:01 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger