SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: Rotating tips

  1. #1
    SitePoint Zealot Ace Nova's Avatar
    Join Date
    Aug 2000
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i need to know how id rotate the contents of an array by the date, every time the date changes, it goes to the next part of the array and once it reaches the end itll go back to the start
    Ace Nova
    Football Man
    InternetSprite.Com - Coming Soon!

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What does the array look like? What is the key to the array?
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #3
    SitePoint Zealot Ace Nova's Avatar
    Join Date
    Aug 2000
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the key is basically numbers 1+
    Ace Nova
    Football Man
    InternetSprite.Com - Coming Soon!

  4. #4
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is just a shot in the dark but I guess you could set a cron job to run nightly that would open a file and read the number and increment it and write the new number back to the file every night, then you could use php to read in the number and use that variable for the array index.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  5. #5
    SitePoint Zealot Ace Nova's Avatar
    Join Date
    Aug 2000
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    not quite sure what that is
    Ace Nova
    Football Man
    InternetSprite.Com - Coming Soon!

  6. #6
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    On a Unix server it is timed script that can be set to run at a given interval. In this case it would be night then it is copied into the cron folder for daily events probably /etc/cron.daily
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  7. #7
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    For instructions on cron, use Telnet or SSH to log into your Unix shell and type the command man crontab.

    For a related example, see the following page of my PHP/MySQL tutorial:

    http://www.webmasterbase.com/article...d=228&pid=1178
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference


Bookmarks

Posting Permissions

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