I want to execute the contents of a variable.
EG:
<?
$exec="phpinfo();";
$exec;
?>
(doesn't work)
Is there a way to do this?
This is what you want
$exec = "phpinfo();"; eval($exec);
be careful. if you allow users to have access to tamper with such variables, in this case, $exec , then they can do some nasty stuff with your server.