REX: Dyanmic Code Example

index.rex :
<?php
$REX->ExecFile("dynamic-rex.php");
?>

dynamic-rex.php :
<?php
// Dynamic REX Example - generate a REX (PHP) file using PHP itself
// lots of escaping required
echo "<?php\n";
$date = @date("Y-m-d h:i:s");
echo "\$REX->Set(\"server-date\",\"".$date."\");\n";
echo "echo \"Server Date: \".\$REX->Get(\"server-date\").\" <BR />\\n\";\n";
echo "echo \"Client Date: \".@date(\"Y-m-d h:i:s\").\" <BR />\\n\";\n";
echo "?>\n";
?>



REX Code Example - © Copyright 2010 David Cutting, All Rights Reserved Licenced under the GNU General Public Licence Version 3