SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    I LOVE THIS SITE ! ! ! DougD's Avatar
    Join Date
    May 2000
    Location
    San Diego, CA
    Posts
    463
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi All,

    Is there a way to rotate the following 5 .txt files on my site?

    <?include "domainlist1.txt";?>
    <?include "domainlist2.txt";?>
    <?include "domainlist3.txt";?>
    <?include "domainlist4.txt";?>
    <?include "domainlist5.txt";?>

    Thanks,

    Doug

  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)
    Do they have to rotate or can they be random. If so:

    PHP Code:
    $textfiles = array("domainlist1.txt""domainlist2.txt""domainlist3.txt""domainlist4.txt""domainlist5.txt");

    //Seed the random number
    srand((double)microtime()*1000000);
    $randval rand (0,(count($textfiles)-1));

    include(
    $textfiles[$randval]); 
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #3
    I LOVE THIS SITE ! ! ! DougD's Avatar
    Join Date
    May 2000
    Location
    San Diego, CA
    Posts
    463
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Random is perfect! That is exactly what I wanted!

    Thanks a lot!

    Doug

  4. #4
    I LOVE THIS SITE ! ! ! DougD's Avatar
    Join Date
    May 2000
    Location
    San Diego, CA
    Posts
    463
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is there a way to make the random text refresh if they hit the back button? I saw the effect on some site, but I am not sure if it was in php or not.

    Thanks,

    Doug

  5. #5
    SitePoint Zealot cokeman's Avatar
    Join Date
    Dec 2000
    Location
    So. California
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think you'd just have to send headers telling the browser not to cache the page. Then it would reload the page each time.


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
  •