Digital Flow Software dhtml popup window

Advanced DHTML Popup Technology made easy, fast and customizable  

Advanced DHTML Popup
DHTML Popup windows made easy

PHP/MySQL Images Database for DHTML Content Management

3. DHTML Popups with PHP/MySQL

A simple demonstration of the combined use of DHTML Popups with PHP and MySQL is shown. We will see that by using simple functions available with Advanced DHTML Popup the content, size and position can all be dynamically updated. In the present case the content and position are generated on the server by means of an image id and size attribute.

A row of thumbnails is generated and by clicking on one of them a full size image is shown in a DHTML popup next to it. The position of the full image is adjusted according to that of the thumbnail and the size according to the full image size. The contents are called via the id number, so that the path of the images on the server is not accessible.

Since the images are all stored (by reference in this case) in a database then the page is easily changed to reflect new images (such as products for example) without editing the HTML at all.


See the demo


The code:

Apart from the linked JavaScript files for the DHTML Popup used with the full-sized images, the only relevant code in the demo page is a PHP include:

<?php
include("construct_imgs.php");
?>


This file constructs the set of thumbnails and the content strings for the full-sized image popup:



When the page is served the resulting HTML is:



Each table cell contains an image surrounded by an <a> tag containing an onclick handler. This calls the dynamic functions of Advanced DHTML Popup which control the appearance and content of the DHTML popup containing the full-sized image.

The <img src='getimage.php?id=001&t=t' calls another PHP function which retrieves the image from the MySQL database for the thumbnail.

Each content string for the larger images in the popup are written below this. These are just div's with an image, whose source is again called from the database with

src='getimage.php?id=001&t=f'

Now lets look at the essentials of the MySQL database function getimage.php:



The database has only one table and three columns in this simple case, an id, a thumbnail name and a full-sized image name. These are selected according to the parameters passed and a path constructed. The image is then read from the path and returned.


Article Index  


Jim Cantrell - Freebits

"I would like to thank you for creating a product that allows me to target specific pages on my site whilst not annoying my visitors. Advanced DHTML Popup is easy to use and the options are endless, plus your excellent support which helped me to create something different make this money well spent. I can only wait to see what new templates will appear in future upgrades. Thank you Digital Flow Software." Freebits
[Graded transparency slide-in popup for redirection]

User Sites & Testimonials


Supports all standard methods of page entry, automatic or manual triggering, scripting capabilities for extensions


Wide range of customization options, including the ability to overlay any chosen image including transparencies


Use with server-side script (ASP, PHP etc.) and databases (e.g. MySQL) for dynamic variable substitution, content, links etc


Create and embed multiple popups in a single page to appear either sequentially or simultaneously


Range of templates supplied, some of which contain special additional script functions

 Registered Copyright

Copyright & Legal  |   This Web Site and all contents are Copyright © 2005-2008 by Digital Flow Software. All Rights Reserved