Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-25-2011, 07:51 AM   PM User | #1
mnkhaki
New Coder

 
Join Date: Oct 2011
Posts: 44
Thanks: 7
Thanked 0 Times in 0 Posts
mnkhaki is an unknown quantity at this point
Exclamation Auto Update

Hi everyone - I am not sure if this falls under "php" but of course, I use php on my website, so here goes:

Would anyone be able to assist with a code for updating information on a daily basis?

For example, I wish to update a section of our site every day that has the following timing information:

Everything is tabulated in excel and/or csv, and it also has on line pages in monthly format, but on the main index page, I just need to have a small area that provides it on a daily basis without having to go to an individual monthly page.

Dawn
Sunrise
Mid Day
Sunset

Hope this make sense!

In the same regard, a code that has QUOTES can also be included with daily (automatic) changes.

Any help would be greatly appreciated!

Thank you!
mnkhaki is offline   Reply With Quote
Old 11-25-2011, 11:42 AM   PM User | #2
Arnaud
Regular Coder

 
Join Date: Jan 2008
Location: Geneva, Switzerland
Posts: 413
Thanks: 12
Thanked 29 Times in 29 Posts
Arnaud is on a distinguished road
I think you are looking for cron jobs. Not sure I understood your case though but try to google that. There are also online services for automated scripts. http://www.webcron.org is one.
__________________
Chuck Norris counted to infinity.
Twice.

Last edited by Inigoesdr; 11-26-2011 at 08:00 PM..
Arnaud is offline   Reply With Quote
Old 11-25-2011, 11:50 AM   PM User | #3
mnkhaki
New Coder

 
Join Date: Oct 2011
Posts: 44
Thanks: 7
Thanked 0 Times in 0 Posts
mnkhaki is an unknown quantity at this point
Quote:
Originally Posted by Arnaud View Post
I think you are looking for apache cron jobs. Not sure I understood your case though but try to google that. There are also online services for automated scripts. http://www.webcron.org is one.
Hi, thanks for replying

I looked at the site you gave me, but I doubt that's what I need.

All I need is a section on my site that updates automatically everyday (changes every midnight of course).

Example:

I have a years chart of sunrise and sunsets and I display it on my site, monthly (www.domain.com/february)

Now, even though I have a page for it, I want a section on the index page that automatically shows SUNRISE and SUNSET for the current day, so users can just look at it and dont need to go to /february page if they want only todays info.

Is there a way to do that?
mnkhaki is offline   Reply With Quote
Old 11-25-2011, 05:33 PM   PM User | #4
devinmaking
Regular Coder

 
Join Date: Oct 2011
Posts: 236
Thanks: 11
Thanked 5 Times in 5 Posts
devinmaking has a little shameless behaviour in the past
Quote:
Originally Posted by mnkhaki View Post
Hi, thanks for replying

I looked at the site you gave me, but I doubt that's what I need.

All I need is a section on my site that updates automatically everyday (changes every midnight of course).

Example:

I have a years chart of sunrise and sunsets and I display it on my site, monthly (www.domain.com/february)

Now, even though I have a page for it, I want a section on the index page that automatically shows SUNRISE and SUNSET for the current day, so users can just look at it and dont need to go to /february page if they want only todays info.

Is there a way to do that?
No-one would be able to help without knowing how your website is written.

This sounds like some php work with a cron job.
devinmaking is offline   Reply With Quote
Old 11-26-2011, 07:49 AM   PM User | #5
mnkhaki
New Coder

 
Join Date: Oct 2011
Posts: 44
Thanks: 7
Thanked 0 Times in 0 Posts
mnkhaki is an unknown quantity at this point
Quote:
Originally Posted by devinmaking View Post
No-one would be able to help without knowing how your website is written.

This sounds like some php work with a cron job.
Devin - the website is www.mombasajamaat.org

On the left is where i wish to have a daily update (see www.sijny.org) on the header area on the left... it has the daily timings.

Are we still looking at php/cron job?
mnkhaki is offline   Reply With Quote
Old 11-26-2011, 12:30 PM   PM User | #6
devinmaking
Regular Coder

 
Join Date: Oct 2011
Posts: 236
Thanks: 11
Thanked 5 Times in 5 Posts
devinmaking has a little shameless behaviour in the past
Quote:
Originally Posted by mnkhaki View Post
Devin - the website is www.mombasajamaat.org

On the left is where i wish to have a daily update (see www.sijny.org) on the header area on the left... it has the daily timings.

Are we still looking at php/cron job?
Again it all depends how often the csv, excel is changing.

If it only changed once and a while you and the times all stay the same you can use php only by just asking for the time like this:

PHP Code:
$gettime gmdate('H:i'); 
and then do a switch to determine which data is showing at a specific time.

For instance here is a tutorial on how to create a switch:

http://www.tizag.com/phpT/switch.php

Hope this helps.
devinmaking is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:21 PM.


Advertisement
Log in to turn off these ads.