SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Member
    Join Date
    Jun 2009
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Rotate header image

    Hi

    I am looking for the code to rotate header image

    can anybody please help

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    What do you want to trigger the rotation?

    Every page load? Date? Time of day? User preference?

  3. #3
    SitePoint Member
    Join Date
    Jun 2009
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i want to rotate header image

    if i have 7 header images then it will rotate as someone refresh or go to other page

  4. #4
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    $images = array('image1.jpg''image2.jpg''image3.jpg''image4.jpg''image5.jpg''image6.jpg''image7.jpg');

    echo 
    $images[rand(0,7)]; 

  5. #5
    SitePoint Member
    Join Date
    Jun 2009
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok will please tell me where i have to store this images

    or does it need source path

  6. #6
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You can use absolute URLs, paths relative to the root of the site, or relative paths to the script location depending on where that code will be.

  7. #7
    SitePoint Member
    Join Date
    Jun 2009
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok i will try the code

  8. #8
    SitePoint Member
    Join Date
    Jun 2009
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your support

    I have tried this code in the site & it works fine

    Quote Originally Posted by Dan Grossman View Post
    You can use absolute URLs, paths relative to the root of the site, or relative paths to the script location depending on where that code will be.


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
  •