PHP & Preprocessed Web Pages
by Betsy Gamrat

Listing One

<?php
/*
webrefresh.php
--------------
Web interface to run a command-line PHP script.  
The system command is simulated with an echo command for the 
demonstration.
The /usr/local/bin/php is the PHP processor, with the full path.
cmdline.php is the name of the PHP script.
parameter is an optional parameter.
*/
echo '<br><b>Refreshing home page content</b><br>';
echo 'system ("/usr/local/bin/php cmdline.php parameter");';
echo '<br><b>Done</b><br>';
?>


Listing Two

<!--
refresh.php
-----------
This is a demonstration of the use of the meta refresh tag to update dynamic 
content. In this case, every 5 seconds, the quotes script will run and 
display a random quote. If you create dynamic pages that need to be refreshed,
this ensures that site visitors will have current data. The second refresh 
tag can be used to redirect site visitors to a different page.  
-->
<html>
<head>
<title>Refresh Tag Demonstration</title>
<!-- Simple refresh tag demonstration, refresh this page after 5 seconds -->
<meta http-equiv="refresh" content="5">
<!-- Refresh tag that redirects the site visitor to a 
different page after 30 seconds 
<meta http-equiv="refresh" content="30;url=http://www.google.com/"> --> 
<meta http-equiv="content-type" content="text/html" >
</head>
<body>
<?php
    include "../quotes/quotes.php";
?>
</body>
</html>





1


