Monday, May 2, 2011

[php-objects] Re: eval function - I don't know what I am doing wrong...

 

Is $str defined some where?

--- In php-objects@yahoogroups.com, "gregaizi" <gregaizi@...> wrote:
>
> All manual suggest about the same code as examples:
> <code>
> <?php
> $name = 'Mary';
> $name2 = 'Ana';
> $a = 'My friends are called $name and $name2';
> print $a . "<br>";
> eval("\$a = \"$a\";");
> print $a . "<br>";
> ?>
>
> </code>
> and it works.
>
> But it does not work in my code
> <code>
> $s=file_get_contents($_GET['p']); //PAGE
> if (!eval("\$str = \"$s\" ;")) {fwrite($f,"error evaluating!\n"); $errorflag=true; }
> </code>
> the content of the $s is a php-program ECHOing some data...
>
> Or how I can call php for a program, catch and use all of its output in the calling php-program?
>
> Thanks in advance
>

__._,_.___
Recent Activity:
Are you looking for a PHP job?
Join the PHP Professionals directory Now!
http://www.phpclasses.org/jobs/
.

__,_._,___

No comments: