This is the code I use to display the edition of the Rotary newsletter, Viewpoint, however, I am not a "clever" user of PHP. So, suggestions on improving the script is always welcomed.
Todd
<?php
// The name of the directory containing the selected Viewpoint is
// passed in the URL
$rvars = $REQUEST;
$vp_dir = $rvars["dir"];
$path_parts = pathinfo($SERVER["SCRIPT_NAME"]);
$server = $_SERVER["HTTP_HOST"];
// Create the URL to the Viewpoint HTML file
$http_path = "http://" . $server . $path_parts["dirname"] . "/" . $vp_dir . "/";
if ($vp_dir) {
// Get the first HTML file in the directory (there should only be one)
$fullfilename = glob("./" . $vp_dir . "/*.html");
$filename = basename($fullfilename[0]);
// Create the target URL
$target = $http_path . $filename;
header("location: " . $http_path . $filename);
}
?>