Jump to content

Archived

This topic is now archived and is closed to further replies.

Tandem

Time limits/delays ?

Recommended Posts

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

Share this post


Link to post
Share on other sites
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...?

Share this post


Link to post
Share on other sites
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 loop

if($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.

Share this post


Link to post
Share on other sites
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 loop

if($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 loop

if($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.

link
http://uk.php.net/date

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.