How can I limit the number of comments to be put into my MySQL database?

2 replies
I have a website with Hostgator and I'll plan on using PHP / MySQL for comments
(I don't want to use Disqus or anything like that - I want comments to become part of outputted HTML for SEO purposes).

I don't want people to be able to insert an endless amount of comments into the database. Do you know of a script I could use to limit the number of comments per day.
#comments #database #limit #mysql #number #put
  • Profile picture of the author Anditya
    Hi, must have more details to answer your Question... Hope I share correct reply here...

    * If you put some little code (at any PHP + SQL script) like :
    Code:
    SQL : WHERE (db_post_field < 501 AND db_topic_id = 'ID')
    PHP : if (true){echo'Post Field';}
    else{echo'Sorry, We Currently Got 500 Comments';}
    {{ DiscussionBoard.errors[6110069].message }}
  • Profile picture of the author Earnie Boyd
    First you want to limit the number of submits per minute. Then number of submits per 3 minutes should be (NUMBER PER MINUTES * 2). Base these limits on session id. Then to limit the IP address per day, store the IP address in the DB and count the number of submits based on the date.
    Signature
    {{ DiscussionBoard.errors[6110876].message }}

Trending Topics