hi,
my problem is with eval.
I have in a "parse_me.html" file, a mix of HTML & PHP3. The PHP3 code in the "parse_me.html" file is very basic.
Using my 'application', I read through the "parse_me.hml" file copying the HTML line for line, and when it hits PHP3 code it is suppossed to process the code, using the eval() statement.
e.g. sample from "parse_me.html"
<head>
<body>
<? if ($value == $today) echo "HELLO WORLD; ?>
</body>
so when my application processes this file, the line with the PHP3 code is stored
in $complete_code
$complete_code = 'if ($value == $today) echo "HELLO WORLD";';
eval ("\$new_str = \"$complete_code\";");
the data stored in $new_str is:
if (1 == 0) echo "HELLO WORLD";
instead of "HELLO WORLD".
does anybody have any way of resolving this problem.
many thanks in advance,
alan
http://www.ireckon.com