Re: eval results to string?
| From: | Julian Wood | Date: | Wed, 11 Oct 2000 05:52:04 +0000 |
| Subject: | Re: eval results to string? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-19512@lists.php.net to get a copy of this message | ||
on 10/10/00 10:08 PM, Daniel Convissor at danielc@analysisandsolutions.com
wrote:
>
> Hi Julian:
>
>> I have a file with perfectly reasonable php code in it (full of php tags and
>> html - call it core.php). The php file that is called by the web browser
>> (called wrapper.php) contains lots of post variables - these are needed and
>> used by core.php. So just a call to eval right? Well eval evaluates it
>> properly, but also insists on dumping it to stdout, while neglecting to
>> place it in the variable. Anyone found a way to do this?
>
> Seems like you really want to be using include("./core.php"), or require().
> Remember, if core.php has functions in it, you'll have to global the
> variables you're planning to use inside each function, or at least global the
> $HTTP_POST_VARS and loop through it using
>
> while ( list($Key,$Val) = each($HTTP_POST_VARS) ) {
> # do stuff ...
> }
>
> --Dan
Well, I looked into include or require, but neither can get me to a point
where I can take the resultant data and send it off in an email message
(that I can see). I'm still stuck with trying to get a parsed php file into
a variable that I can pass through to the mail command. How do you mail a
file that you include?
With regards to the $http_post_vars, they are in fact within the scope of
core.php, whether I use eval, include or require (ie they are all accessible
without globalization). This part is not a problem.
Thanks,
Julian
--
Julian Wood
Learning Technologies and Digital Media
University of Calgary