note 45307 added to function.eval
| From: | MWB at osu1 dot php dot net | Date: | Wed, 01 Sep 2004 19:00:25 +0000 |
| Subject: | note 45307 added to function.eval | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-75894@lists.php.net to get a copy of this message | ||
I use this to quickly (and easily) test PHP examples. Save the following as eval.php (or whatever)
and use it like: 'eval.php?eval=phpinfo();' Or use it without the '?eval=' and
then enter something in the text field and press enter, or by copying (like from the examples here)
and pasting in the textarea field and click "eval".
<?php
// don't make anything like this publicly accessible!
if (isset($_GET['eval'])) {
eval(stripslashes($_GET['eval']));
exit;
}
?>
<form method=get action="<?php echo $_SERVER['PHP_SELF'];?>">
<input type=text name=eval>
</form>
<form method=get action="<?php echo $_SERVER['PHP_SELF'];?>">
<textarea rows=10 cols=30 name=eval>
</textarea>
<input type=submit value="eval">
</form>
----
Manual Page -- http://www.php.net/manual/en/function.eval.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+45307
Delete -- http://master.php.net/manage/user-notes.php?action=delete+45307&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+45307&report=yes
Search -- http://master.php.net/manage/user-notes.php