Page 1 of 1
Parse Php files stored in MySQL
Posted: Mon Sep 03, 2007 1:04 am
by japi
Let's say i have this stored in a BLOB or TEXT column on MySQL:
Code: Select all
<html>
<strong><?php echo("Hello, ") ?></strong>World
</html>
Is there a way to tell PHP to parse the BLOB/TEXT column, so the output looks like:
Hello, World
I mean, is there a way to tell PHP to treat the MySQL column as a file?[/b]
Posted: Mon Sep 03, 2007 1:07 am
by s.dot
VERY tentively speaking,
eval().
yeah... but...
Posted: Mon Sep 03, 2007 5:53 am
by japi
I thought the same thing, but wen you try to eval() that, it gives you an error aout an "unexpected '<' on line 1 ".
eval() as far as i know works with pure php code, and this is html code with some php tags along the way.
Is there a way to tweak eval()? or is there another way to accomplish this?
Posted: Mon Sep 03, 2007 6:31 am
by s.dot
The user comments on the manual page provide some interesting takes on that problem.
Posted: Mon Sep 03, 2007 7:49 am
by japi
I swear i've read that thing like a thousans times...
ok so all i need to do is close the php mode "?>"... i swear it would be a lot harder. Thanks