Display images from a folder (slide show)

I try google and find out how to make a .php script that will make an automatic slide show of images from a folder, I managed to get the photos automatically in php, but I canโ€™t figure out how to make them move one by one like a slide show.

Here is the URL of the page on which the images are displayed, so you can see Here is the code I used.

<? $files = glob("images/*.*"); for ($i=0; $i<count($files); $i++) { $num = $files[$i]; echo '<img src="'.$num.'" alt="random image" />'."<br><br>"; } ?> 

Do you know how to do this? Or another way to do this? simpler? Java / XML?

+4
source share
1 answer

To affect the client side, you need to use JavaScript. PHP only allocates static content on the server.

Here is a list of options you could use.

+1
source

Source: https://habr.com/ru/post/1398825/


All Articles