note 45307 deleted from function.eval by tomsommer
| From: | tomsommer@php.net | Date: | Wed, 01 Sep 2004 20:17:52 +0000 |
| Subject: | note 45307 deleted from function.eval by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-75896@lists.php.net to get a copy of this message | ||
Note Submitter: MWB
----
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>