时间:2021-07-01 10:21:17 帮助过:21人阅读
$num_to_guess) {
$message = $_POST['guess']." is too big!";
} elseif ($_POST['guess']>$num_to_guess) {
$message = $_POST['guess']." is too small!";
} else {
$message = "I am terribly confused.";
}
}
file_put_contents("php://input");
?>
A PHP number guessing script
写了一个关于猜数字的PHP程序,在mac上用mamp运行,接收不了表单$_post数据
但在windows上用camp运行就没问题,求教这是怎么回事?
这是代码:
$num_to_guess) {
$message = $_POST['guess']." is too big!";
} elseif ($_POST['guess']>$num_to_guess) {
$message = $_POST['guess']." is too small!";
} else {
$message = "I am terribly confused.";
}
}
file_put_contents("php://input");
?>
A PHP number guessing script
1.前段用调试工具查看一下请求数据是否正确
2.php打印$_REQUEST,看看数据是否正确接收