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
 
Unread Codewalkers Forums Sponsor:
  #1  
Old April 24th, 2002, 03: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, 03: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: 25
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, 05: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, 02: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: 3
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, 02: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!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

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




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek