PHP image slideshow auto

A solid implementation of an image slideshow gallery. Fully automated, no setup needed.


For a quick setup:

1. Create a folder for the slideshow images.
2. Drop images for the slideshow in the folder.
3. Grab the code, paste it in a file and call it "index.php"
4. Upload this file to a directory that will be the gallery (
5. Change lines 6 and 8 to correspond to your setup.
6. Run it (use URL from step 4)



Posted on 27.02.2016 08:17 by dwimyn


Posted on 04.02.2016 08:28 by guest

can run in php 4.0.9.. tq

Posted on 17.01.2016 13:13 by guest

Hi this ist a great Slideshow.
If there's a fade effect, they would be perfect.

Posted on 08.10.2015 11:50 by guest

Hi steve. PRIMA!!!, it works perfect, thank you!
But what if there are some videos in folder, when they also output on screen.
That'd be great. Are you able to have it in mind! Please!
THX. Alistair

Posted on 03.06.2015 11:18 by guest

so great..Gracias!

Posted on 04.11.2014 10:01 by guest


Posted on 31.10.2014 06:43 by guest

Nice one!!!!! Gr8 Job....

Posted on 29.10.2014 18:04 by guest

nice start

Posted on 08.06.2014 02:46 by guest

Thank you so much for this wonderful php SlideShow.

Posted on 06.04.2013 12:11 by guest


Posted on 28.10.2012 05:04 by guest

Cant seem to figure out where to get the images from, i cant seem to understand your variables XD

Posted on 07.10.2012 17:56 by guest

Not bad but a bit misleading as you said auto, in fact we have to press next. Maybe you could do one for auto ie the image changes on its own with the user not needing to press anything :)

Posted on 19.08.2012 02:20 by guest

Yes, it works for defined sized pics... Big pics, not so nice. But, it's a starting point. Thanks!

Posted on 27.07.2012 03:08 by guest

good, thanks

Posted on 12.07.2012 17:01 by guest

doesnt work for me

Posted on 27.06.2012 08:06 by guest

Thanks for the code. You did a good job.
But I have one problem. I couldn't open big sized photos.
Did you set image size anywhere?

Posted on 25.06.2012 13:04 by guest

i have failed with the editing of lines 6 and 8, for those who succeeded, please show me how you made your changes. thanks

Posted on 09.06.2012 06:59 by guest

Thanks and keep it up........,

Posted on 09.05.2012 12:00 by guest

DEMO example is really needed to really understand what i am developing and if it is really what i need.

Posted on 17.04.2012 04:53 by guest

I am new to PHP but and I am looking for some code to create a slideshow. Can anyone email me and explain the code to me a bit mail id is

Posted on 02.04.2012 22:29 by guest

I can't get my image to show??? and I don't understand this,,,, so close.

To solve the problem of not displaying the image use this code on line 129 to 134: Use the complete <?php ?> for all php open and close tags.

<?php echo $caption; ?>

First | PreviousNext | Last


Posted on 27.03.2012 11:35 by guest

I am new to PHP but and I am looking for some code to create a slideshow. Can anyone email me and explain the code to me a bit better as I am trying to figure it out but just seem to be very confused and unable to get the script working. thanks a million!

Posted on 14.03.2012 20:47 by guest

this is

Posted on 14.03.2012 10:08 by guest

To achieve order in images add the line
before the line
$_SESSION['imgarr'] = $this->files_arr;

Posted on 12.03.2012 15:53 by guest


To solve the problem of not displaying the image use this code on line 129 to 134: Use the complete <?php ?> for all php open and close tags.

<?php echo $caption; ?>

First | PreviousNext | Last


Posted on 12.03.2012 15:15 by guest

*what shall i name the images...(correction)

Posted on 12.03.2012 15:14 by guest

Please directory path is C:/wamp/www/images/slideshow , what shat i name the images? they are .jpg extention. I tried img1.jpg, img2.jpg, I tried 1.jpg , 1.jpg it doesnt work. Please help, aside from the two lines of code to modify in lines 6 and 8 are there any more to modify? Thanks...

Posted on 27.02.2012 14:28 by guest


Posted on 25.01.2012 17:04 by guest

Good job Man,Sharing ideas,Thank you very much

Posted on 21.01.2012 21:27 by guest

The program works great! Your instructions were clear and easy to understand.

Posted on 22.12.2011 19:20 by guest

Thanks a lot, great script! Had to made a few changes to use it for multiple galleries, but it works fine.
Why don't you put a demonstration on your page? Would be helpful.

Posted on 20.12.2011 05:59 by guest

kool.... :)

Posted on 09.12.2011 20:30 by guest

This works perfectly so far! However, it sorts through the photos in the gallery folder in a random order. Is there a way to specify the order in which the photos are loaded? Thanks!

Posted on 01.10.2011 11:52 by guest

hello ,my name is david noori your scripts is very good but i need demo of your script.why you use not demo?
i wate for your

Posted on 29.08.2011 19:32 by guest

not bad

Posted on 21.07.2011 07:35 by guest

Thanks, very useful!
What to write on line 8, if this php file and images are in the same folder?

Posted on 15.07.2011 07:16 by guest

good of u thanks for sharing

Posted on 09.06.2011 10:37 by guest

This is not an automated script dont user this instead of there are so manu available based on javascript

Nikhil Patel.

Posted on 12.05.2011 22:13 by guest

To find the absolute path:

<?php echo $_SERVER['DOCUMENT_ROOT']; ?>

1. Copy and paste the above code in a blank page
2. Save it as absolutepath.php
3. Upload it via FTP to the location where you intend to install your images for the slideshow
4. Open your favorite browser and enter the URL to point to this file:
- Example:
5. That's it, you should have your absolute path displayed in the screen.

Found these instruction on:

Posted on 23.04.2011 15:36 by guest

This code exposed a weird problem under Snow Leopard:\

If there's no /etc/php.ini, this code works fine. If there is, the PHP code prints out at the top of the page, beginning with "init()) != '') { header('HTTP/1.1 500 Internal Server Error'); ..." followed by an empty picture reference (question mark) and the First | Previous Next | Last anchors.

This prevents this nice little piece of code from working on properly configured commercial hosts. I would REALLY like to use it, but I don't know nearly enough about PHP admin/setup to solve this problem for myself.

Anyone having a solution, please email me at


Posted on 23.04.2011 07:32 by guest

it won't work automatically....

Posted on 15.04.2011 12:55 by guest

Sorry i'm not Php programmer. Can nobody tell me in line 6 & 8 and example for me.

Posted on 03.02.2011 10:56 by guest

useful my site thank...

Posted on 10.12.2010 16:33 by guest

This blows to be honest....

Posted on 10.12.2010 00:25 by guest

Steve, I can't get this to load the image directory. Tried checking root and www settings on line 6 & 8, still no go? Help!

Posted on 29.11.2010 07:25 by guest

Thx, works fine only one problem. When U klick next the page uppdates, so itt will jump back to the top of the page. How can i fix?

Posted on 20.09.2010 13:22 by guest

I like this very much. I am a php programmer and Thank you very much for this code.

Posted on 17.07.2010 07:50 by steve

You will have to use Javascript setTimeout() for this.
It will be something along these lines:

(inside javascript tag at the bottom of the page)
setTimout("window.location.href='?img=<?=$next;?>';", 3000); // 3 secs

Posted on 17.07.2010 04:09 by guest

Nice job.

Any chance to have the images rotate automatically in an given interval?

Thanks for your reply,

Posted on 15.07.2010 16:11 by guest

Good !!!! Thanks a lot

Posted on 09.06.2010 22:46 by steve

Reading for the text widget at the site, I believe you
can add an iframe with the URL as src. Then the gallery will be displayed.
Just guessing, I am not a Wordpress user.

Posted on 09.06.2010 20:34 by guest

Can anybody help explain how you would do #6 in wordpress? How would you access this php from a text widget in your sidebar?

Posted on 09.05.2010 06:01 by steve

Here is a working page with the script:

Posted on 04.02.2010 18:33 by guest

A demonstration of what the end result will look like would be nice :)

Posted on 23.01.2010 12:34 by zamg0d1

Can I add this to my own existing site?

Posted on 05.11.2009 18:59 by guest

Thanks a lot!

Posted on 30.11.2008 04:07 by guest

Not bad