If I'm guessing right, $this->html contains a mix of HTML and <?php ?>
stuff. eval won't work since it expects the string to contain only PHP. What
you probably need to do is to write this string into a temporary file and
include that in the view script.

But this is madness. Just refactor the whole thing to fit the ZF paradigm.
The future maintainers  of this application (probably the future you) will
thank you.

   -- Mon


On Tue, Feb 2, 2010 at 8:05 AM, Gregory Cheung <[email protected]> wrote:

> I'm not sure why you would even want to do that...The view is supposed to
> generate the html code and the code that generated the code you want to
> pass
> into eval() should be in a model.
>
> Implementing an application using the zend front controller pattern, only
> to
> call eval() on an existing php script really defeats the purpose of even
> using zend framework.
>
> You could think about just picking out components in zend framework which
> you find useful rather than trying to make it do something it wasn't
> designed for.
>
> And to answer your question...is it possible you have php errors in the
> code
> contained in $this->html?
>
>
>
> -----Original Message-----
> From: debussy007 [mailto:[email protected]]
> Sent: 01 February 2010 23:02
> To: [email protected]
> Subject: [fw-general] Re: Echo a string containing the full php webpage -
> issue
>
>
> How can there be a risk ?
> The html code is generated server side, not client side.
> If a user (evil) has access to the server, well then he may just select all
> files and press delete ... that's the same risk.
>
> I tried
> <?php eval($this->html); ?>
> and also
> <?php echo eval($this->html); ?>
>
> But it doesn't work:
> Parse error: parse error in
>
> C:\Data\websites\cms\application\modules\admin\views\scripts\interface\view.
> phtml(1)
> : eval()'d code on line 1
> --
> View this message in context:
>
> http://n4.nabble.com/Echo-a-string-containing-the-full-php-webpage-issue-tp1
> 459193p1459367.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>
> __________ Information from ESET Smart Security, version of virus signature
> database 4825 (20100201) __________
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
>
> __________ Information from ESET Smart Security, version of virus signature
> database 4825 (20100201) __________
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
>
>

Reply via email to