Tandem Posted July 17, 2006 Share Posted July 17, 2006 Ok, on my website, i want my members to only be able to do certain things after a time limit has passed.For example, i only want them to be able to submit a certain form once a day.How do i go about doing that?I couldn't google it bbecuse i didn't know what it would be called.Thanks in advance.-Tandem Quote Link to comment https://forums.phpfreaks.com/topic/14856-time-limitsdelays/ Share on other sites More sharing options...
pixy Posted July 17, 2006 Share Posted July 17, 2006 Maybe set a cookie on their computer with the time, then request it and see if enough time has passed for them to use the features...? Quote Link to comment https://forums.phpfreaks.com/topic/14856-time-limitsdelays/#findComment-59433 Share on other sites More sharing options...
redarrow Posted July 17, 2006 Share Posted July 17, 2006 Insert the date in the database with the users id ect ect then do a date diffrence of 1 day ok.example only//database date$database_date="17/06/06";$d=date("d")+1;$date_know=date("$d-m-y");//select statement// while loopif($what_ever['database_date']==1) {echo "sorry you have submitted already";}else if ($date_know - $what_ever['database_date']){submit code}Example only ok for an idear. Quote Link to comment https://forums.phpfreaks.com/topic/14856-time-limitsdelays/#findComment-59446 Share on other sites More sharing options...
Tandem Posted July 17, 2006 Author Share Posted July 17, 2006 What about if i want the delay to be in minutes or hours? Quote Link to comment https://forums.phpfreaks.com/topic/14856-time-limitsdelays/#findComment-59465 Share on other sites More sharing options...
redarrow Posted July 17, 2006 Share Posted July 17, 2006 example only 1 hour change//database date$database_time="10:00:00";$h=date("h")+1;$date_know=date("$h:i:s");//select statement// while loopif($what_ever['database_date']==1) {echo "sorry you have submitted already";}else if ($date_know - $what_ever['database_date']){submit code}example only 30 min change//database date$database_time="10:00:00";$m=date("m")+30;$date_know=date("$m:i:s");//select statement// while loopif($what_ever['database_date']==1) {echo "sorry you have submitted already";}else if ($date_know - $what_ever['database_date']){submit code}look up date() function or time() function.linkhttp://uk.php.net/date Quote Link to comment https://forums.phpfreaks.com/topic/14856-time-limitsdelays/#findComment-59476 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.