NYCPHP Meetup

NYPHP.org

[nycphp-talk] eval;

Kayra Otaner kayraotaner at yahoo.com
Sun Jun 23 21:20:56 EDT 2002


Did you try to start output buffering in the code that you used in eval function? I think it may
work. Simply replace your code with output buffered version :

ob_start();
echo "hello";
$output = ob_get_contents();
ob_end_clean();

and then echo $output for echoing content of your php code stored in database.

Kayra Otaner


--- Ian Forsyth <ian at plusfour.org> wrote:
> I am setting a basic CMS type thing.
> 
> Speediness aside, I am storing any all content in the db.
> 
> Basically i am trying to store php in the db that I want to do and eval();
> on. To get started I inserted the following into the db -
> 
> echo "hello";
> 
> and am doing the following for the result set
> 
> $str = eval($row['content']);
> 
> question-
> 
> Storing the value in $str does nothing and output buffering didn't seem to
> work; how can i control where the eval gets spit out?
> 
> I have read about doing addslashes and stripslashes, but that does not seem
> to work in my case....
> 
> regards,
> Ian
> 
> 


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com



More information about the talk mailing list