note 55576 deleted from function.eval by danbrown
| From: | danbrown@php.net | Date: | Tue, 25 Nov 2008 16:07:18 +0000 |
| Subject: | note 55576 deleted from function.eval by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-146942@lists.php.net to get a copy of this message | ||
Note Submitter: alexandrebr at ignorethis dot gmail dot com
----
Like said before, use of 'eval' is not recommended, by the security issues.
A good use of eval, is to test your codes without having to create/save files on the hard drive.
You may want to create the script below, and send to your server, to help you to manage your
database, for example...
<?
if(isset($_POST["code"])){
$code = get_magic_quotes_gpc()?
stripslashes($_POST["code"]):
$_POST["code"];
eval("?>".$code);
}
else{
echo "<form method='post' action='eval.php'>";
echo "<textarea name='code'></textarea><br>";
echo "<input type='submit' value='Test the code above'>";
echo "</form>";
}
?>
With this, you can easily exec PHP codes on your site, without having to connect to the FTP and
uploading files.....
Even tests with extensions like PHP_GD are allowed.
WARNING: If you wish to use the example above, PUT A PASSWORD PROTECTION! The function EVAL gives
fully access to your site, so be careful.