Imagine a template system that works by getting a file, as a string, and
then putting it through eval(), something like this:
$formAsString = $controller->command("readFileAndReturnString", $formName);
// 06-22-07 - the next commands try to import all the functions that the
form
// contains, so we don't get "Fatal Error: Undefined Function".
$arrayOfNeededFunctions =
$controller->command("matchAllPhpFunctionsInString", $formAsString);
$arrayOfTrueAndFalseResults = $controller->command("loopArray",
$arrayOfNeededFunctions, "getNeededFunctionsEach");
// 06-22-07 - (must end php or I get errors)
$phpEnd = "?";
$phpEnd .= "";
$formAsString = $phpEnd.$formAsString;
echo "<p>in importForm: <hr$formAsString";
eval($formAsString);
The echo statement, which I just put there, shows the string about like
what I'd expect. Yet, on this page, I get a blank:
http://www.cyberbitten.com/my_privat...ples_posts.htm
A blank in the middle of the page, where I am trying to import a
sub-template. Normally, if I get blank, it means that there is a parse
error in the file being included. And yet, if I ssh to the server and
examine the error log, it is empty. If I deliberately invoke an error on
another page (in this case, weblog.php), then that appears in the error
log, but no parse error does:
root@ldc310:/usr/local/bin# tail php_errors
[16-Jun-2008 20:06:42] PHP Warning: mime_magic: type regex
BEGIN[[:space:]]*[{] application/x-awk invalid in Unknown on line 0
[16-Jun-2008 20:07:03] PHP Parse error: syntax error, unexpected
T_STRING in /var/www/vhosts/cyberbitten.com/httpdocs/weblog.php on line 68
[16-Jun-2008 20:07:05] PHP Parse error: syntax error, unexpected
T_STRING in /var/www/vhosts/cyberbitten.com/httpdocs/weblog.php on line 68
[16-Jun-2008 20:07:07] PHP Parse error: syntax error, unexpected
T_STRING in /var/www/vhosts/cyberbitten.com/httpdocs/weblog.php on line 68
[16-Jun-2008 20:07:07] PHP Parse error: syntax error, unexpected
T_STRING in /var/www/vhosts/cyberbitten.com/httpdocs/weblog.php on line 68
So, what else could it be? My next thought was that it was an infinite
loop, but there are no loops on the page, only a call to my loop()
command, which has protections against infinite looping.
What would allow that string to echo to the screen, yet have the eval()
not generate anything for the screen, and there be no error in the error
log?