I need a script which allows a new image to load after refresh or page load

Discussion in 'Web Design and Development' started by macaddict23, Apr 27, 2010.

  1. macaddict23 macrumors 6502

    macaddict23

    Joined:
    Jun 20, 2006
    Location:
    MacVille, USA
    #1
    I have a total of four images. Each image is a 10-second GIF animation. Each image will need to be linked to a URL.

    Thanks!
     
  2. 7on macrumors 601

    7on

    Joined:
    Nov 9, 2003
    Location:
    Dress Rosa
    #2
    So are you wanting to pull certain images when a visitor accesses the page through specific urls?

    i.e. page1.php sees 1.gif
    page2.php sees 2.gif...
    and so on?

    And ? # 2, are you running on a PHP server?
     
  3. macaddict23 thread starter macrumors 6502

    macaddict23

    Joined:
    Jun 20, 2006
    Location:
    MacVille, USA
    #3
    Animation1.gif shows up on the home page, and it loops until a user clicks on a relative or absolute link anywhere on this page. When the user decides to go back to the home page, I want Animation2.gif to show up. Click on a link, back to the home page, Animation3.gif shows up. And so on . . .

    Yes, I'm on a PHP server.

    Thanks!
     
  4. 7on macrumors 601

    7on

    Joined:
    Nov 9, 2003
    Location:
    Dress Rosa
    #4
    This sounds close to what you want to do:
    http://www.bigresource.com/Tracker/Track-php-p8vAEby3/

    What you want is to count how many times that page is viewed. (start a session, etc.) and do a conditional (i.e. if($pagecount == 1) {$img ='Animation1.gif';} if($pagecount == 2) {$img ='Animation2.gif';} and so on).
     
  5. macaddict23 thread starter macrumors 6502

    macaddict23

    Joined:
    Jun 20, 2006
    Location:
    MacVille, USA
    #5
    Hmmm . . . thanks for the link, but I have no knowledge of PHP. I'm simply looking for a copy-and-paste script where all I have to do is add the image names and URL destinations.
     
  6. macaddict23 thread starter macrumors 6502

    macaddict23

    Joined:
    Jun 20, 2006
    Location:
    MacVille, USA
    #7
    Hmmm . . . none of these are not working at all. The images swap only when I do a hard refresh (Command + R).
     
  7. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #9
    So, then all of them are working then. Lovely double negatives.

    Anyways, it sounds more like a cache issue than anything. Trying setting some tags so the page does not cache or expires right away.
     

Share This Page