PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old April 24th, 2002, 02:50 AM
JamieBond JamieBond is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 3 JamieBond User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Can anyone help me with a timer?

Hello, i've just learned basic PHP for this script I needed for my page. Im pretty much finished, except for the most important aspect.

I need one of my variables to increase by 1 every day at a cirtain time automatically (Or have a timer increase it every 24 hours)

Any help would be much apreciated, thanks

Reply With Quote
  #2  
Old April 24th, 2002, 02:58 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Can anyone help me with a timer?

Have a variable increase every day at a certain time? Is this a script you are running from a command line and it runs in a constant loop? If not, variables get reset every time a script is run.

Explain what exactly you are trying to accomplish here and I'm sure we can figure something out...


Reply With Quote
  #3  
Old April 24th, 2002, 04:11 AM
JamieBond JamieBond is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 3 JamieBond User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Can anyone help me with a timer?

ok i dont really know what im doing. I will explain what im trying to do.

Im starting up a little web comic, and im writing an uptator script for it. So far what it does is it makes next/previous buttons work, adds the apropriate image for each day, and when it gets to the $today value, it stops going forward. So of course I $today to increase by 1 value every day so that it updates automatically. I assumed this could be done in PHP... If not does anyone have any other suggestions?

Reply With Quote
  #4  
Old April 26th, 2002, 01:09 AM
sethadam1 sethadam1 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Orlando, FL
Posts: 223 sethadam1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Can anyone help me with a timer?

I wouldn't try to increase the variable each day. Instead, I'd rely on the date() function.
For example, you could create an array and use a while loop, and then populate the array based on date. First name your comics for each day, like this:

comic0425.jpg
comic0426.jpg
etc...

Then, if the comic array is called "comicarray,":

---------------------------------
$day = date("d"); //gets day
$month = date("m"); //gets month
$inserter = "1"; //pace variable
while ($inserter <= $day) {
//sets name of comic
$add = "comic" . $month . $day . ".jpg";
//adds comic to array
$comicarray[] = $add;
//increase pace, runs again
$inseter++; }

----------------------------
now you have array to work with. And you can echo each item of the array as a link or as an image...

-Adam

Reply With Quote
  #5  
Old April 26th, 2002, 01:55 AM
JamieBond JamieBond is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 3 JamieBond User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Can anyone help me with a timer?

ah! I didnt even know about the date() function (Like i said i really dont know what im doing)

Thank you very much for your help, i will experiment and get it working now i think =)

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > Can anyone help me with a timer?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five &quot;checkpoints&quot; for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway