Restricting a user to open my website

Hi Forum,

I have a search engine, user searching different string related to business.

I am recording search per user with user-IP. ONce the searches exceeds from 50 search for that day…

i want to RESTRICT that user…

Now the main problem is how to restrict THAT PARTICULAR user opening my website.

How do i do that, if user enters my website or any internal page address…WEBSITE SHOULDN’T BE OPENED.

thanks in advance.

Then user goes to Google or Bing anyways and never return to your site…
Very good solution you have there.

You’re seriously worried about user using the search 50 times on one day?
How about if google were to block anyone who made 50 searches a day, they’d sure be out of business right now.
50 searches a seconds, that’s worrysome. 50 searches a day is just a curious user.

That would be a Spammer…

It’s quite easy really


$ipOfOffendingUser = '1.2.3.4';
if ($_SERVER['REMOTE_ADDR'] == $ipOfOffendingUser) {
  die();
}

Put it at the top your PHP script(s).

BTW, how can someone who’s just searching be classified as a “spammer”. A spammer would be someone that adds useless content/junk to your website. Searching doesn’t add anything (unless you show a list of “last searches” or “popular searches” of course).

Also, remember that on some networks, multiple users can have the same IP…