1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Image slider/rotator php code help

Discussion in 'PHP' started by peaceandlove, May 11, 2022.

  1. #1
    http://partswala.byethost6.com/

    you can see a small aeroplan like banner at top

    upload_2022-5-11_11-55-42.png

    What I want is to change this image as slider

    I want to change the image after every 30 secondons and it can be even 2-10 any number of images.

    Currently i writed this code to bring this image
    SEMrush
    ?>
    <?php

    $cookies_name = "cookiesBanner";
    $cookies_val = '<img style="height:50px; width:320px; margin-top:10px;" src="<?php echo $path ?>/images/cimg.jpg">';
    setcookie($cookies_name, $cookies_val, time() +(86400 * 30 * 30), "/");
    //print_r($cookies_val);
    ?>


    Complete code of page is also attachea as tempalte.txt

    This is just a dummy site for demo purpose only so I am ready to give username and password too for any person who needs to help

    let me know how can i make the images to work as slider one by one after every 30 seconds.

    I already uploaded few ohher images on site , links are

    http://partswala.byethost6.com/images/banners/osmbanner2.png

    http://partswala.byethost6.com/images/banners/banner1.jpg

    Notes its a joomla template
     

    Attached Files:

    peaceandlove, May 11, 2022 IP
    SEMrush
  2. peaceandlove

    peaceandlove Well-Known Member

    Messages:
    155
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #2
    I found this script

    https://www.phpsnaps.com/snaps/view/php-image-slideshow-auto

    and it work too but it does not making it auto rotato rather giving option to rotate using click, i want to auto rotate after 30 seconds
     
    peaceandlove, May 11, 2022 IP
  3. hdewantara

    hdewantara Well-Known Member

    Messages:
    519
    Likes Received:
    47
    Best Answers:
    23
    Trophy Points:
    130
    #3
    Hi, I think javascript may help your auto rotate.
     
    hdewantara, May 11, 2022 IP
  4. peaceandlove

    peaceandlove Well-Known Member

    Messages:
    155
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #4
    Any link for a perfect code, want to put in joomla template.php file
     
    peaceandlove, May 11, 2022 IP
  5. hdewantara

    hdewantara Well-Known Member

    Messages:
    519
    Likes Received:
    47
    Best Answers:
    23
    Trophy Points:
    130
    #5
    I have zero experience in Joomla, sorry :(
    But perhaps I could give this a try with pure PHP, HTML and js:
    http://smokingscript.com/pages/_img-rotator/
    I'll share source codes here if you like to adopt them into anything ;)
     
    hdewantara, May 11, 2022 IP
  6. hdewantara

    hdewantara Well-Known Member

    Messages:
    519
    Likes Received:
    47
    Best Answers:
    23
    Trophy Points:
    130
    #6
    hdewantara, May 12, 2022 IP
  7. peaceandlove

    peaceandlove Well-Known Member

    Messages:
    155
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #7
    Thanks hdewantara , so nice of you
     
    peaceandlove, May 13, 2022 IP
  8. hdewantara

    hdewantara Well-Known Member

    Messages:
    519
    Likes Received:
    47
    Best Answers:
    23
    Trophy Points:
    130
    #8
    you're welcome :)
     
    hdewantara, May 13, 2022 IP