Here is the code you get a form with, you can submit php code, it gets evaluated on the server.
SECURITY WARNING: command(s) below will be all executed in PHP’s server context! Deny public acces.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PHP evaluator</title>
</head>
<body>
<div>
<?php
$function = "eval";
$arguments = "return true";
if ($_SERVER['REQUEST_METHOD'] == "POST") {
$result = null;
$function = $_POST["function"];
$arguments = $_POST["arguments"];
switch ($function) {
case "eval":
$result = eval($arguments . ";");
break;
default:
$result = $function($arguments);
}
echo "<hr/>";
var_dump($result);
echo "<hr/>";
print_r($result);
echo "<hr/>";
echo($result);
}
?>
</div>
<hr>
SECURITY WARNING: command(s) below will be all executed in PHP's server context! Deny public acces.
<form method="POST">
<textarea name="arguments" style="width: 600px; height:200px"><?php echo $arguments ?></textarea>
<br/>
Function: <input type="text" name="function" value="<?php echo $function ?>" />
<button>EXECUTE</button>
</form>
</body>
</html>
Views: 500

3 Comments
http://www.phppoet.blogspot.com
http://www.phppoet.blogspot.com
http://www.phppoet.blogspot.com