我希望能够从表单提交一个值,然后调用提交的函数,我的代码:
<?php
include 'specs.php';
if (empty($_POST) === false) {
$func = $_POST['function'];
$a1 = $_POST['a1'];
$a2 = $_POST['a2'];
$a3 = $_POST['a3'];
$a4 = $_POST['a4'];
$a5 = $_POST['a5'];
echo $func.'('$a1', '$a2', '$a3', '$a4', '$a5');';
}
?>
<form action="" method="post">
Function:<br><input type="text" name="function"><hr>
Value 1: <input type="text" name="a1">
Value 2: <input type="text" name="a2">
Value 3: <input type="text" name="a3">
Value 4: <input type="text" name="a4">
Value 5: <input type="text" name="a5">
<input type="submit" value="Execute">