PHP Slideshow


There are two versions. Both files have the same name! It's up to you to rename the files or store them in separate folders. Click the screenshot of the version you want. A description of the PHP script is below the two screenshots.


Top Navigation

Top Navigation


Left Navigation

Left Navigation


Description

You put text, picture, and sound files in the same folder with the PHP script on your server. Or any one or two of those file types. Make sure all related files have the same base name (like "flower.jpg" and "flower.txt"). The script will find all related files, sort them, and display each related group of files as a slide in a presentation.

The "Left Navigation" version creates links to each slide. The link text matches the file name minus any leading numbers, dashes, and underscores.  The "Top Navigation" version does not create links for individual pages. Other than that difference, the scripts are the same.

The PHP presentation script requires PHP 4.1 or newer on the server. It will work on a Linux or Windows server as long as the base PHP is installed. No special PHP extensions are used.

The generated web pages use client-side JavaScript, but will still work with client-side scripting disabled. The generated web pages use CSS, but they'll will work without it. Automatic advancement between pages only works on IE with scripting enabled. Otherwise, you have to click the nav buttons to advance to the next page. For all browsers, if scripting is enabled, focus moves to the "Next" nav button after the page loads, so you can use your "Enter" button to go to the next page and your "Backspace" button to go back.

For maximum visibility, you might want to tell your viewers to press "F11" (in FireFox and IE, at least) to view the presentation fullscreen. The presentation does NOT attempt to resize the client browser.

As written, the script looks for sound files by extension in this order:
mid, wma, mp3, au, wav
If multiple files (like "flower.wav" and "flower.mp3") exist, the one on the right in this list will be used. There's no reason why multiple files should exist, so this really shouldn't be an issue!

As written, the script looks for text files by extension in this order:
txt
Yes, that's right. Only the txt file extension is checked for plain text. What else is there?

As written, the script looks for picture files by extension in this order:
bmp, png, jpg, jpeg, gif, htm
The same rules apply about base name collisions: The extension on the right of this list will be used.

Yes HTM files are considered as pictures! You'd use an HTM file if you needed something an ordinary picture and text couldn't handle. This gets kind of strange.