0. What is the PAD SDK?

The PAD SDK is a set of include files implementing some classes as an easy to integrate interface on PAD files. This part of the SDK includes PHP sample files in the samples sub-directory along with the include files in the include sub-directory.

1. Extracting Data from a PAD File

Extracting data from a PAD file with the PAD SDK is very simple. Authors may want to use this code on their web pages to extract data like the current version number directly from the program's PAD file. This obsoletes having to update the web page on program updates.

Here is the sample code for extracting the product name and version from a local PAD file:

<?php

// Includes
include_once("./include/padfile.php");

// Create PAD file object for the local file "pad_file.xml"
// This could also be an absolute local path or an URL!
$PAD = new PADFile("./samples/pad_file.xml");

// Load file
if ( !$PAD->Load() )
  echo 
"Error: Cannot load PAD file.<br>\n";

// Sample Output
echo "<b>Program Name:</b> " $PAD->XML->GetValue("XML_DIZ_INFO/Program_Info/Program_Name") . "<br>\n";
echo 
"<b>Program Version:</b> " $PAD->XML->GetValue("XML_DIZ_INFO/Program_Info/Program_Version") . "<br>\n";

?>

And this is how the output will look like: