Forum Moderators: coopster
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;';
<?print_before($rs->fields['before']);?>
<html>
...
<?print_after($rs->fields['after']);?>
...
</html>
This an example of the functions:
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?
$rs->fields['before'] = '$GLOBALS["name"] = "Andres";';
$rs->fields['after'] = 'echo $GLOBALS["name"];';
Umm...yea..something like that. Hope this helps.