Accessibility
Günter Schenk

Günter Schenk

Adobe Community Expert

Table of Contents

Created:
23 July 2007
User Level:
Intermediate
Products:
Dreamweaver

Exchanging data using the Spry framework for Ajax and PHP

This tutorial describes a rather uncommon, yet sensible approach to exchanging data between PHP and the Spry framework for Ajax. Both the tutorial and the ready-to-use demo application address the following functionality:

  • Making your Spry-enhanced Dreamweaver page tell a PHP script to generate an image list from a specified directory. The path to your desired image subdirectory can be an arbitrary sequence of static parameters (e.g., "foldername") or dynamic parameters (e.g., values derived from a recordset)—a flexible solution for adding a Spry-based "show related images" feature to your content management system (CMS).
  • Simultaneously passing back the evaluated information to the very same Spry page as on-the-fly XML data in order to have a Spry table build an image list from the specified directory, and also providing a variety of sortable critera, such as image-related data (URL, width, and height) and file-related data (name, date, and extension).
  • Simultaneously, but optionally, creating a static XML file containing all the current nodes and values.

Requirements

In order to complete this tutorial, you need to install the following software and files:

Dreamweaver CS3

Spry Prerelease 1.4

Sample files:

  • Define a Dreamweaver site with a testing server or remote server running Apache 1.3 (or later), MySQL 3.23 (or later), and PHP 4 (or later). Other servers might also work, but have not been tested.
  • Make this PHP configuration setting: allow_url_fopen = on
  • Install phpMyAdmin (or a similar MySQL administration tool) to import the provided articles.sql file, which will add the table adobe_xml_imagelist to your existing database.
  • Optional: When enabling the script's Generate Static XML Files option, set write permission (e.g., 755) for the script's base folder on the remote server.

Prerequisite knowledge

You should be familiar with creating Dreamweaver recordsets, using the Spry table widget, and have a basic understanding of PHP. To get up to speed with PHP using Dreamweaver, read Setting up a PHP development environment for Dreamweaver by Charles Nadeau.

About the author

Günter Schenk started building private, small-scale static websites in 1997 and has localized software and websites for foreign clients, such as Guitar Pro and Audio Compositor. He has also been a freelance musician for about 23 years, playing guitar, bass, balalaika, and banjo as well as teaching and recording sessions from Classical music to punk. From 2000–03 Günter served a couple of regional customers (mostly industry, theater, and arts) with more serious and demanding websites, which started to contain something that became more and more fascinating to him: PHP and database interaction. He acquired his knowledge the "hard way," by coding, reading instructions and manuals, and testing approaches with care, something he still considers a virtue.

Since 2004, Günter has been employed by a former customer, a Turkish real estate company, where he manages their German customer support and advertising agency. In addition to selling their homes and hanging out at property exhibitions, his major and rather self-imposed tasks have been actually something much cooler: developing their multilingual websites, designing a custom-made property database which included all the bells and whistles like enquiry tracking, and feeding other custom-made areas like the distributor area, CMS systems, etc. During this period, Günter became a "Team Interakt" member, which turned out to provide great in-depth training and give him the chance to collaborate with a wonderful bunch of folks.