Eval() and Extract()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi guys, i need some urgent help at something.

I have my index.php which executes some code BEFORE printing any
output, and then executes some code AFTER some of the output has been
already printed.

Lets suppose that:
$rs->fields['before'] = '$name = "Andres";';
$rs->fields['after'] = 'echo $name;';

Code:

<?print_before($rs->fields['before']);?>
<html>
...
<?print_after($rs->fields['after']);?>
...
</html>

This an example of the functions:
Code:

function print_before($code) {
 eval($code);
}

function print_after($code) {
 extract($GLOBALS, EXTR_SKIP);
 eval($code);
}

The problem is that print_after() is not getting the $name value that
has been already seted in print_before().

Any ideas?



-- 
Slds,
Andrés Santos Kunze, IIG
(593) 9 7026627


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Check out the new improvements in Yahoo! Groups email.
http://us.click.yahoo.com/6pRQfA/fOaOAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

PHP Data object relational mapping generator
http://www.metastorage.net/ 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-objects/

<*> To unsubscribe from this group, send an email to:
    php-objects-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 




[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux