Printed from http://kimbriggs.com

Creating an HTML Thumbnail Table via a PHP Script

Note: This page is concerned with generating HTML when you already have your thumbnails and photos. I have another page if you want a script that can create thumbnails and/or put a tagline on your photos.

This page describes a PHP script that can be used to create an HTML table of thumbnailed images. There are two ways to make use of the create HTML table PHP script.

First Method:

Copy and paste the "loops logic" from the create HTML table PHP script. It is marked in the comments of the script, roughly from lines 55 to 135. Substitute my variables with your variables and that's about it. Change the thumbnails to straight images or other items if you don't want thumbnail images.

Second Method:

Creating HTML pages one at a time on your development machine for later upload to a server.

  1. Copy the two files "create-html-table-form.txt" and "create-html-table-action.txt" to your local machine. This is not a service for you to use.
  2. Save them in the same directory somewhere near your photos in web-server directory that is set up with PHP. One directory up from your target photo directories would be a very convenient spot.
  3. Change the name of "create-html-table-form.txt" to "create-html-form.html".
  4. Change the name of "create-html-table-action.txt" to "create-html-table.php".
  5. You need to edit them for your own file structure and delete my leftover stuff. Any text editor will do.
  6. If you don't have a series of photo pages, delete the series-specific stuff as well.
  7. And if you don't have thumbnails, you'd want to change the items in the table from links to straight HTML image (or object) elements (tags).
  8. Browse to the "create-html-table.html" file, fill in the blanks and click the button.
  9. You should have a formatted HTML-table-web-page-thing. Use the "File..Save As" type of command to save it where you want it. Save as "HTML Only" and NOT "Web Page Complete".

Mistakes I make. After not using it for a while, I'll browse to the "create-html-table-form.html" file with a web browser and wonder why it doesn't work. The answer is I can't browse to it in the file system. You need to go through http://localhost/path/from/document/root to get the server and php engine to kick in. Yup. Done that more than once. Also, to avoid making copies of the script, I'll keep it in a higher directory and target several new directories at once. The page it creates will not have any pictures viewable until after you save it to the proper directory and reload it. I'm getting pretty good at remembering that now...

What's good about this script.

What's not good about this script.

Did I mention, It is not set up to work over the net?

Google
 
CC License Ubuntu Bluefish Editor Graphics by GIMP Eliminate DRM Get Firefox php.net Play Ogg Valid XHTML 1.0 why the icons?