PHP Pre-Processing with XMake: PHP Templating |
>> << source: build-versus-run-time.php.phpc |
<?php
// USAGE:
// build-versus-run-time.php?user=greg&lang=es
// this code will be executed at build time
$build_date=date("l dS of F Y h:i:s A");
?>
<html>
<head>
<title>phpc example: build versus run-time code execution</title>
</head>
<body>
This file was built on: <?= $build_date;?><br>
<?php
// register prerequisite file including run-time code:
$prerequisite_file="build-versus-run-time.inc";
phpc_add_prerequisites( $prerequisite_file );
// read in the run-time code file
readfile($prerequisite_file);
?>
<b class="comment">begin embedded run-time code</b><br>
<?= PHP_OPEN_TAG;?>
// this code will be executed at run time
import_request_variables ("GPC");
echo ("user=$user\n<br>");
echo ("language=$lang\n<br>");
<?= PHP_CLOSE_TAG;?>
<b class="comment">end embedded run-time code</b><br>
</body>
</html>
>> << Copyright (c) 2003, Gregory Keranen. All rights reserved. |