Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
selectric
Regular
Regular



Joined: Aug 06, 2008
Posts: 65

PostPosted: Sun Jan 03, 2010 10:13 am Reply with quote

Hello! Thanks for your time in looking at this post.
I have a custom News section, with a custom Printer friendly articles. What I would like is to create some sort of pre check code, that will find out if the visitor is accessing the printer version article FROM the original article, or "referred" from the original article link, and if not, do something else.

I don't want people sending visitors to my printer version articles. Any ideas? Thanks!
 
View user's profile Send private message
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Thu Jan 14, 2010 6:34 am Reply with quote

Not sure how we missed this one selectric. Sorry about that. Take a look at this code in includes/nukesentinel.php as it should give you the ideas that you need:

Code:


function get_referer() {
  global $nuke_config;
  if(get_env("HTTP_REFERER")) {
    if(stristr(get_env("HTTP_REFERER"), $nuke_config['nukeurl'])) {
      return "on site";
    } elseif(stristr(get_env("HTTP_REFERER"), "http://localhost") || stristr(get_env("HTTP_REFERER"), "http://127.0.") || stristr(get_env("HTTP_REFERER"), "http://192.168.") || stristr(get_env("HTTP_REFERER"), "http://10.") || stristr(get_env("HTTP_REFERER"), "file://")) {
      return "local link";
    }
    return get_env("HTTP_REFERER");
  }
  return "none";
}

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©