Prevent Spam Script

Discussion in 'PHP' started by miexl, Oct 19, 2009.

  1. #1
    Hi i want to create a simple site similar to twitter that lets user update their status on what they are doing.

    Can someone help how to create a script written in php that prevent user to post many status at the same time?
     
    miexl, Oct 19, 2009 IP
  2. TheMadBlackHatter

    TheMadBlackHatter Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    A script preventing spam should be the least of your worries. If you can code a Twitter clone, you can easily implement a feature as simple as flood prevention.
     
    TheMadBlackHatter, Oct 19, 2009 IP
  3. Hosting24

    Hosting24 Member

    Messages:
    431
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    35
    #3
    I'm sorry to say, but words "twitter" and "simple" should not be used in the same sentence. If you believe coding Twitter-like site is as easy as 1-2-3, coding powerful antispam script should take no longer than 1 minute for you.
     
    Hosting24, Oct 19, 2009 IP
  4. AsHinE

    AsHinE Well-Known Member

    Messages:
    240
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    138
    #4
    In short idea of such a script can be the following.
    Remember date and time of latest status. Check if some time pased (2 minutes for example) from latest status change. If passed - allow to change status, if not - disallow or show captcha.

    For those whos taking about "simple" and "twitter", miexl said "similar to twitter". He just want to let users change statuses, he is not talking about any friends or retweets or anything like that.
     
    AsHinE, Oct 19, 2009 IP
  5. TheMadBlackHatter

    TheMadBlackHatter Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    If you read my post you'd realize I said "you can easily implement a feature as simple as flood prevention." Which should take no longer than 5 minutes to code.
     
    TheMadBlackHatter, Oct 19, 2009 IP
  6. OneHundredNetwork

    OneHundredNetwork Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    As above said, flood prevention is very easy.

    Something as simple as using timestamp field with each status entry within your database. Then looking up the last known entry for that user; grab the time stamp and compare that against the current time() to provide you with a value of how long they have waiting inbetween posting new status's.
     
    OneHundredNetwork, Oct 19, 2009 IP
  7. orionoreo

    orionoreo Peon

    Messages:
    145
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    here's what comes to mind for me

    1. user registration required
    2. user logs in to post
    3. post status posted with timestamp
    4. user can't repost within 30 seconds of last post
     
    orionoreo, Oct 19, 2009 IP
  8. Hosting24

    Hosting24 Member

    Messages:
    431
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    35
    #8
    TheMadBlackHatter, my post was dedicated for topic author.
     
    Hosting24, Oct 20, 2009 IP
  9. TheMadBlackHatter

    TheMadBlackHatter Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    I'm sorry about the harsh response then. :p
     
    TheMadBlackHatter, Oct 20, 2009 IP
  10. Hosting24

    Hosting24 Member

    Messages:
    431
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    35
    #10
    No problems. I had to quote topic author when posting a new reply...
     
    Hosting24, Oct 20, 2009 IP