Jump to content


Photo

Time limits/delays ?


  • Please log in to reply
4 replies to this topic

#1 Tandem

Tandem
  • Members
  • PipPipPip
  • Advanced Member
  • 251 posts

Posted 17 July 2006 - 02:59 PM

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

#2 pixy

pixy
  • Members
  • PipPipPip
  • Advanced Member
  • 295 posts

Posted 17 July 2006 - 03:03 PM

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...?

This is a .44 Caliber Loveletter straight through my heart.

Tabulas + Threadless + Hire Me!


#3 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 17 July 2006 - 03:15 PM

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.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#4 Tandem

Tandem
  • Members
  • PipPipPip
  • Advanced Member
  • 251 posts

Posted 17 July 2006 - 04:02 PM

What about if i want the delay to be in minutes or hours?

#5 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 17 July 2006 - 04:24 PM

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
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users