It's not especially pretty and there isn't any error trapping, so please don't use this on any sort of production data. This will display the schema of a paradox data source....
<?
if ($_POST['database_name'] != "") {
$database_filename = "<path to your data file>".$_POST['database_name'];
echo "<p><b>Schema for ".$_POST['database_name']."</b></p>\n";
if(!$pxdoc = px_new()) {
DIE("Problem !");
}
$fp = fopen($database_filename, "r");
if(!px_open_fp($pxdoc, $fp)) {
DIE("Couldn't open database file");
}
else {
$stock_schema = px_get_schema($pxdoc);
if (is_array($stock_schema)) {
foreach ($stock_schema as $key=>$value) {
echo "<br><b>".$key."</b> - Type ".$value['type'];
}
}
}
px_close($pxdoc);
px_delete($pxdoc);
fclose($fp);
}
else {
echo "<form action=\"show_schema.php\" method=\"post\">\n";
echo "<p>Data Source Name (include extension) : <input type=\"text\" size=\"10\" name=\"database_name\"></p>\n";
echo "<p><input type=\"submit\" value=\"Show Schema !\">\n";
echo "</form>\n";
}
?>