Can anybody help me to build a form where I can put a limitation that if I click on the form once, than I cannot do that again for next 5 minutes.the form has only one fiels that is email address.
crazynp 0 Junior Poster in Training
Recommended Answers
Jump to Post— php_daemon 3The easiest way is using database to store the last form submit time by an IP.
Here's the idea:
create table timer( ip varchar(255), timestamp int )$ip=mysql_real_escape_string($_SERVER['REMOTE_ADDR']); $time=time(); $timeout=time()-5*60; mysql_query("DELETE FROM timer WHERE timestamp<$time"); $r=mysql_query("SELECT * FROM timer WHERE ip='$ip'"); if(mysql_num_rows($r)>0) { …
Jump to Post— digital-ether 399The easiest way is using database to store the last form submit time by an IP.
Here's the idea:
create table timer( ip varchar(255), timestamp int )$ip=mysql_real_escape_string($_SERVER['REMOTE_ADDR']); $time=time(); $timeout=time()-5*60; mysql_query("DELETE FROM timer WHERE timestamp<$time"); $r=mysql_query("SELECT * FROM timer WHERE ip='$ip'"); if(mysql_num_rows($r)>0) { die("You've already submitted …
All 7 Replies
php_daemon 3 Junior Poster
digital-ether 399 Nearly a Posting Virtuoso Team Colleague
crazynp 0 Junior Poster in Training
php_daemon 3 Junior Poster
crazynp 0 Junior Poster in Training
php_daemon 3 Junior Poster
digital-ether 399 Nearly a Posting Virtuoso Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.