I have a file that contains the code below. My script reads the file and then puts it into a variable...
<br><br>
<?php
$SESSION['file'] = $SERVER['SCRIPT_FILENAME'];
$_SESSION['strip_images'] = "No";
echo "Today is: " . date("l dS of F Y h:i:s A");
?>
<br><br>
This is the last line to print.
Now I want to execute the code and echo the results. So I remove the <?php and ?>. Then I echo the results and I get nothing.
Here's the code
$PHPrint = str_replace( "<?php", "", $PHPrint );
$PHPrint = str_replace( "?>", "", $PHPrint );
$PHPrint = stripslashes("$PHPrint");
eval("\$PHPrint = \"$PHPrint\";");
echo $PHPrint;
Any ideas what I am missing?