View Single Post
Old 06-12-2007, 06:47 PM  
ASACP Cal
Registered User
 
Join Date: Jun 2007
Location: Vancouver, BC
Posts: 6
This is an interesting question.

With the first example if $_SERVER['HTTP_REFERER'] doesn't evaluate to whatever php thinks of as false it won't work. If you tested for a specific refererrer it might however. One way to do this where there may be many possible "right" answers would be to use a regular expression:

if (!preg_match('#^http:/+mydomain.com#',$_SERVER['HTTP_REFERER'])) die("can't view this link directly!");

I'm wondering if apache config could be doctored in some way to prevent this eg using mod_rewrite.
ASACP Cal is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook