1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

flood protection using text file but not cokkies or mysql?

Discussion in 'PHP' started by Birmingham, May 9, 2007.

  1. #1
    looking for a simple script to protect from POST data floods, by writing to and reading from a text file. the simpler the better. any pros here can help? will be really useful for my latest project! ;)
     
    Birmingham, May 9, 2007 IP
  2. gibex

    gibex Active Member

    Messages:
    1,060
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    95
    #2
    - limit post length
    - put an interval between posts
     
    gibex, May 11, 2007 IP
  3. e39m5

    e39m5 Peon

    Messages:
    44
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    It would help to know the type of application, but since your signature says "Chat" im hoping it is a chat. This may be able to handle the problem.

    
    if($_SESSION['lastMes'] == $_POST['mes']){
         //User is flooding, handle as appropriate
    } else {
         //User is not flooding
         //Set lastMes var with new value
         $_SESSION['lastMes'] = $_POST['mes'];
         //Handle as appropriate
    }
    
    PHP:
    e39m5
     
    e39m5, May 11, 2007 IP
  4. Birmingham

    Birmingham Peon

    Messages:
    322
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    e39m5, it's not for chat, it's for an admin system of updating content on a website. posted data will be URLs and anchor text of links on a site.

    gibex, i think your strategy could work well. how would you code it in the simplest way? :eek:
     
    Birmingham, May 12, 2007 IP