Solved

annoying referer

Posted on 2008-10-02
1
208 Views
Last Modified: 2012-05-05
hello there,
I have seen in my awstats logs that about 120 sites from the same owner is sending traffic to my site and its not content related..
I would like to send back all his traffic.. so I can write down all his domains and have a php script that if it came from there then send it back
how can I do this?
0
Comment
Question by:XK8ER
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 22

Accepted Solution

by:
Ivo Stoykov earned 500 total points
ID: 22631461
Hello XK8ER

Here is a simple script that might give you an idea

HTH
I

if(ip2long($_SERVER['REMOTE_ADDR']) >= ip2long('XXX.XXX.XXX.XXX') && ip2long($_SERVER['REMOTE_ADDR']) <= ip2long('XXX.XXX.XXX.XXX'))
{
// it comes from forbidden range and must be cut off
  exit();
}

Open in new window

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question