2017-09-25 124 views
1

我正在使用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> 
+1

你有一個錯字,應該是「行動」而不是「阿克頓」 –

回答

0

你犯了一個錯誤編寫HTML代碼。它應該是action,而不是acton

<html> 
<body> 
<form action="process.php" method="POST"> 

Quantity: <input name ="quantity" type ="text" /> 
    <input type="submit"/> 
</form> 
</body> 
</html>