. //php tutorial limits user 60 seconds post Comment Instance code /* CREATE TABLE ' test '. ' abc ' ( ' id ' int (4) NOT NULL auto_increment, ' Times ' Int (4) NOT null default ' 0 ', ' IP ' varchar null default NULL, Primary key (' ID ') ) engine = MyISAM */ if ($_post) { $conn = mysql tutorial _connect (' localhost ', ' root ', ' root ') or Die (' MySQL server 2001 '); mysql_select_db (' Test ', $conn); $date = time (); $IP = $_server[' remote_addr '];//gets the IP address, which is a test so it's not judged $wait = "Select Times,ip from ABC where ip= ' $ip ' and ($date-times<60) Order BY id DESC limit 1 ";
$rows = mysql_query ($wait) or Die (Mysql_error ()); if (mysql_num_rows ($rows)) { Die (' Sit down and take a rest, you move too fast, please release your message in 60 seconds! '); } Else {
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.