Current File : /home/lifechur/test-static.lifechurchboston.org/scripts/lifegrplistptr.php |
<?php
// PHP SCRIPT: lifegrplistptr.php
header("Content-Type: text/javascript");
// Read tthe HTML file into a PHP array and feed it to Javascript as Javascript array elements.
$htmltext = file_get_contents("lifegrplistptr.html");
$htmlarray = explode("\n", $htmltext);
$count = count($htmlarray);
// Output a starting script tag
//echo("document.write('<script language=\"JavaScript\" type=\"text/javascript\">');\n");
// Declare the templateHTML array
echo("var templateHTML = new Array();\n");
for($i=0;$i < $count;$i++) {
// Copy array contents to a working variable.
$outputtext = $htmlarray[$i];
// Escape any single quote characters
$outputtext = str_replace("'","\'",$outputtext);
// Escape any double quote characters
$outputtext = str_replace("\"","\\\"",$outputtext);
// Output a script line defining the next tempalteHTML element
//echo("document.write(templateHTML[$i] = \"$outputtext\");\n");
//echo("fadeimages[$i]=['$directory/$file', '', ''];\n");
echo ("templateHTML[$i] = '$outputtext';\n");
}
// Output a closing script tag
// echo("document.write('</script>');\n");
// Now we invokde Javascript to process the html from the original article along with the template html.
echo("document.write('<script language=\"JavaScript\" type=\"text/javascript\" src=\"http://www.lifechurchministries.org/scripts/lifegrplistptr.js\"> </script>');\n");
// Let them know who we are here!!!
//echo("document.write('<p>Running lifegrplistptr</p>');\n");
//echo("document.write(\"<p>Hello World</p>\")\n");
// Read tthe $_SERVER data into an array and output it.
//$_servertext = $_SERVER['HTTP_USER_AGENT'];
//$_serverarray = explode("\n", $_servertext);
//$count = count($_serverarray);
//for($i=0;$i < $count;$i++) {
// Escape any double quote characters
//$outputtext = str_replace("\"","\\\"",$_serverarray[$i]);
//echo("document.write(\"$outputtext\");\n");
//}
// Read tthe phpinfo data into an array and output it.
//ob_start();
//phpinfo();
//$phpinfo_output = ob_get_contents();
//ob_end_clean();
//$_serverarray = explode("\n", $phpinfo_output);
//$count = count($_serverarray);
//for($i=0;$i < $count;$i++) {
// Escape any double quote characters
// $outputtext = str_replace("\"","\\\"",$_serverarray[$i]);
// echo("document.write(\"$outputtext\");\n");
//}
?>