hackalive Posted April 2, 2010 Share Posted April 2, 2010 Hi guys, I have a PHP variable $var which is "$header = 'http://'.$_SERVER['HTTP_HOST'].'/'; header("location: $header");" now some how in my php file I need to execute this variable as PHP any ideas, all help is much appreciated Quote Link to comment https://forums.phpfreaks.com/topic/197376-execute-variable-as-php/ Share on other sites More sharing options...
hackalive Posted April 2, 2010 Author Share Posted April 2, 2010 or sometimes it might just be "echo $_SERVER['HTTP_HOST'];" Quote Link to comment https://forums.phpfreaks.com/topic/197376-execute-variable-as-php/#findComment-1035962 Share on other sites More sharing options...
hackalive Posted April 2, 2010 Author Share Posted April 2, 2010 FYI: I have tried exec() with no luck Quote Link to comment https://forums.phpfreaks.com/topic/197376-execute-variable-as-php/#findComment-1035982 Share on other sites More sharing options...
mikesta707 Posted April 2, 2010 Share Posted April 2, 2010 eval() but if you are executing user input, thats not such a good idea Quote Link to comment https://forums.phpfreaks.com/topic/197376-execute-variable-as-php/#findComment-1035992 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.