SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2010
    Location
    IN
    Posts
    93
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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.

  2. #2
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Then user goes to Google or Bing anyways and never return to your site...
    Very good solution you have there.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  3. #3
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,039
    Mentioned
    152 Post(s)
    Tagged
    2 Thread(s)
    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.

  4. #4
    SitePoint Enthusiast
    Join Date
    Jan 2010
    Location
    IN
    Posts
    93
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That would be a Spammer......

  5. #5
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,039
    Mentioned
    152 Post(s)
    Tagged
    2 Thread(s)
    It's quite easy really

    PHP Code:
    $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).

  6. #6
    SitePoint Evangelist mrwooster's Avatar
    Join Date
    Jan 2006
    Posts
    518
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also, remember that on some networks, multiple users can have the same IP.....


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •