note 55576 added to function.eval

From: Date: Mon, 08 Aug 2005 01:32:44 +0000
Subject: note 55576 added to function.eval
Groups: php.notes 
Request: Send a blank email to php-notes+get-93217@lists.php.net to get a copy of this message
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. ---- Manual Page -- http://www.php.net/manual/en/function.eval.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+55576 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55576&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55576&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55576&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55576&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55576&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55576&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+55576&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#93217) next »