Re: eval results to string?

From: Date: Wed, 11 Oct 2000 04:08:24 +0000
Subject: Re: eval results to string?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-19494@lists.php.net to get a copy of this message
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 -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y More than just answers. Solutions. (SM) http://www.analysisandsolutions.com/ 4015 7 Av #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409

« previous php.general (#19494) next »