无法将HTML表单数据传递给PHP文件
问题描述:
我正在使用WAMP,并且我的html表单不向PHP文件发送数据。无法将HTML表单数据传递给PHP文件
我的HTML文件
<html>
<body>
<form acton="process.php" method="POST">
Quantity: <input name ="quantity" type ="text" />
<input type="submit"/>
</form>
</body>
</html>
和我的PHP文件process.php是下
<html>
<body>
<?php
$quantity=$_POST['quantity'];
echo $quantity;
?>
</body>
</html>
答
你犯了一个错误编写HTML代码。它应该是action
,而不是acton
<html>
<body>
<form action="process.php" method="POST">
Quantity: <input name ="quantity" type ="text" />
<input type="submit"/>
</form>
</body>
</html>
你有一个错字,应该是“行动”而不是“阿克顿” –