Jump to content

Time limits/delays ?


Tandem

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.