Jump to content

Time() question


Foser

Recommended Posts

I'm trying to make something that will do something liek this:

 

every 5 minute add 1 to $var1 although i want it so when I leave my browser and come back 10 min later I want to have 2.

how can this be done?

 

<?php 
// time function everuy 5 min execute{
$starttime = 0;
$var1 = $starttime++;
?>

 

Thanks

 

Also I'm trying to display the time using echo time(); its all numbers all together how i manipulate the (inside) of the time function?

 

thanks

Link to comment
https://forums.phpfreaks.com/topic/60552-time-question/
Share on other sites

Doubt it can be done with PHP alone, What you will have to do is to use a HTML header

 

<meta http-equiv="refresh" content="300" />

 

Then use PHP, the number will have to be stored in a session or txt file. You can use PHP to open the txt, find the current number, add 1 to it, and then write the new number to the file. or use a database.

Link to comment
https://forums.phpfreaks.com/topic/60552-time-question/#findComment-301221
Share on other sites

Archived

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

×
×
  • 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.