>I have a BLOB field in a MySQL database that I want
>to parse into my page using PHP.
>For instance, in this field might be the following:
>
><?  echo "test";  ?>
>
>So when I access this field in PHP I want it to display "test".
>
>Is this possible?

Yeah.  That's called "eval" (short for 'evaluate')

Basically you can make PHP execute arbitrary chunks of more PHP code.

NOTE:  Letting web-surfers insert PHP code into your database to be
evaluated later is really high on the Bad Idea list...  Actually, doing this
on a web-site where you're not pretty sure the database itself is pretty
secure from not only surfers but also other potentially malicious co-users
on the same box...  It's just too easy for them to be able to put mean code
in your database...

http://php.net/eval

I *think* it goes like this:

<?php
    $php = 'echo "Hi";';
    eval($php);
?>

Never used it myself...

By Day:                                |By Night:
    Don't miss the Zend Web Store's    |   There's not enough room here...
    Grand Opening on January 23, 2001! |   Start here:
    http://www.zend.com                |   http://l-i-e.com/artists.htm



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to