...

View Full Version : Auto Update



mnkhaki
11-25-2011, 08:51 AM
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!

Arnaud
11-25-2011, 12:42 PM
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.

mnkhaki
11-25-2011, 12:50 PM
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?

devinmaking
11-25-2011, 06:33 PM
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.

mnkhaki
11-26-2011, 08:49 AM
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?

devinmaking
11-26-2011, 01:30 PM
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:


$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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum