Chapter 19: Web Forms Manager 683 processRequest() This method is responsible for the entire process of enabling a user to download the form data. This is how it works: . First, it determines whether the passed form ID is valid. If it is empty, it displays an alert message and returns null. . Next, an object of FormData is created. Depending on the type of download (all records or latest records), the getFormData() or getData AfterRecordID() method is called to retrieve the appropriate data and then store it in the $dataArr array. In the case of the latest data download, the getLastDLRecordID() method is called to retrieve the top record id of the previously downloaded data so that the new download can start after it. . If $dataArr is not empty, a CSV file is created and opened in the temp directory of the application, and the $dataArr values are written in it, separated by commas. . After the data writing in the CSV file is done, the updateDownloadTrack() method is called to store the record id of the row that was last written in the CSV file. . Finally, the user is redirected to the CSV file, from which he can download the data as a CSV file. . If $dataArr is empty, the user is shown an alert message stating that the requested dataset is empty. Installing the Web Forms Manager In this section, it is assumed that you are using a Linux system with MySQL and the Apache server installed. During the installation process for the Web Forms Manager, we will refer to the Web document root directory as %DocumentRoot%. It is also assumed that you have installed the PHPLIB and PEAR libraries. Normally, these are installed during PHP installation. For your convenience, these are provided in the lib/phplib.tar.gz and lib/pear.tar.gz directories on the CD-ROM. In the following sample installation steps, it is further assumed that these are installed in the %DocumentRoot/phplib and %DocumentRoot/pear directories. Because your installation locations for these libraries are likely to differ, make sure that you replace these paths in the configuration files.