Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: Auto Update

  1. #1
    New Coder
    Join Date
    Oct 2011
    Posts
    44
    Thanks
    7
    Thanked 0 Times in 0 Posts

    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!

  • #2
    Regular Coder
    Join Date
    Jan 2008
    Location
    Geneva, Switzerland
    Posts
    413
    Thanks
    12
    Thanked 29 Times in 29 Posts
    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.
    Last edited by Inigoesdr; 11-26-2011 at 08:00 PM.
    Chuck Norris counted to infinity.
    Twice.

  • #3
    New Coder
    Join Date
    Oct 2011
    Posts
    44
    Thanks
    7
    Thanked 0 Times in 0 Posts
    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?

  • #4
    Regular Coder
    Join Date
    Oct 2011
    Posts
    237
    Thanks
    11
    Thanked 5 Times in 5 Posts
    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.

  • #5
    New Coder
    Join Date
    Oct 2011
    Posts
    44
    Thanks
    7
    Thanked 0 Times in 0 Posts
    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?

  • #6
    Regular Coder
    Join Date
    Oct 2011
    Posts
    237
    Thanks
    11
    Thanked 5 Times in 5 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •