Jump to content


Photo

How do I...


  • Please log in to reply
4 replies to this topic

#1 devildog10920

devildog10920
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 04 April 2006 - 12:49 AM

Make a expricy script for a database.... like i want to make a "detention" script and want the "detention" to expire after a certain amount of hours..... How could I do this.

#2 $cripts

$cripts
  • Members
  • PipPipPip
  • Advanced Member
  • 33 posts

Posted 04 April 2006 - 12:50 AM

cron job

#3 devildog10920

devildog10920
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 04 April 2006 - 12:51 AM

[!--quoteo(post=361420:date=Apr 3 2006, 08:50 PM:name=$cripts)--][div class=\'quotetop\']QUOTE($cripts @ Apr 3 2006, 08:50 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
cron job
[/quote]


Im not very familier with that.

#4 khendar

khendar
  • Members
  • PipPipPip
  • Advanced Member
  • 78 posts

Posted 04 April 2006 - 01:08 AM

It means setting up a scheduled task on the server which executes a php script which will do the expiry. Only really useful if your server is running Linux and you have access to the server to do this.

The other way is to have a "time_to_expire" field in a database. And each time the webpage is loaded, it checks to see if the time_to_expire is less than the current time. If it is then set a flag in the databse which indicates that it has expired.

#5 redarrow

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

Posted 04 April 2006 - 01:18 AM

[!--quoteo(post=361421:date=Apr 4 2006, 12:51 AM:name=PHPDesigner)--][div class=\'quotetop\']QUOTE(PHPDesigner @ Apr 4 2006, 12:51 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Im not very familier with that.
[/quote]

I thort i throw this in ok.

$dosomethinkday = '01'; // day of month 
$today = date("M d, Y"); 
$doit = date("M $dosomethinkday, Y"); 
if ($doit == $today) {IF 2 DATES MATCH LET'S DO SOMETHINk}


It will also use the time() format to do somethink ok.
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