lovephp Posted September 8, 2016 Share Posted September 8, 2016 hey all hope all good? well am back after sometime with an issue. well i got my anti flood working ok but what i need is instead of showing time i need to show backward countdown seconds types for next post. my current code which i wrote looks like this what must i do to get anti clock seconds till 1hours is over? $stmt = "SELECT * FROM floodcontrol WHERE memberID = :memberID AND time >= DATE_SUB(NOW(), INTERVAL 1 HOUR)"; $stmt = $db->prepare($stmt); $stmt->bindParam(':memberID', $uid, PDO::PARAM_STR); $stmt->execute(); $f = $stmt->fetch(); $floodcontrol = $stmt->rowCount(); $nextpost = date("H:i:s A", strtotime($f['time'].' +1 hour')); regards Quote Link to comment https://forums.phpfreaks.com/topic/302106-anti-flood-remaining-time-to-countdown/ Share on other sites More sharing options...
ginerjm Posted September 8, 2016 Share Posted September 8, 2016 flood? anti clock? Whatever are you trying to say? Quote Link to comment https://forums.phpfreaks.com/topic/302106-anti-flood-remaining-time-to-countdown/#findComment-1537174 Share on other sites More sharing options...
Jacques1 Posted September 8, 2016 Share Posted September 8, 2016 And why would your users have to wait one hour? What kind of application is this? Quote Link to comment https://forums.phpfreaks.com/topic/302106-anti-flood-remaining-time-to-countdown/#findComment-1537175 Share on other sites More sharing options...
lovephp Posted September 8, 2016 Author Share Posted September 8, 2016 Classified post i don't want users to post non stop thts why i added this to make users wait for an hour till they can make another post Quote Link to comment https://forums.phpfreaks.com/topic/302106-anti-flood-remaining-time-to-countdown/#findComment-1537186 Share on other sites More sharing options...
lovephp Posted September 8, 2016 Author Share Posted September 8, 2016 (edited) flood? anti clock? Whatever are you trying to say? Well in my classified post page im stopping users for an hour till they can make another post, the current nextpost var displays the time an hour from post the original post time. I do i make it reverse as in 130 seconds remaining until you make your next post. I hope you get my point? Edited September 8, 2016 by lovephp Quote Link to comment https://forums.phpfreaks.com/topic/302106-anti-flood-remaining-time-to-countdown/#findComment-1537187 Share on other sites More sharing options...
Solution Jacques1 Posted September 8, 2016 Solution Share Posted September 8, 2016 I have no idea what a “classified post” is, but if you want an actual countdown, you need JavaScript. For example: Make an Ajax request, use PHP to calculate the number of seconds until the next possible submission, then start a JavaScript timer which shows and counts down those seconds. There are thousands of example scripts. Quote Link to comment https://forums.phpfreaks.com/topic/302106-anti-flood-remaining-time-to-countdown/#findComment-1537193 Share on other sites More sharing options...
lovephp Posted September 9, 2016 Author Share Posted September 9, 2016 Its ok no iasue guess i could not explain it well. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/302106-anti-flood-remaining-time-to-countdown/#findComment-1537201 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.