当我提交此表单时,它会下载它引用的 php 脚本:
<form action="insertcustomer.php" method="post" class="myform">
<p>
Name: <input type="text" name="name" size="20"/>
</p>
<p>
Address: <input type="text" name="addr" size="40"/></p>
<p>
City: <input type="text" name="city" size="20"/>
State: <input type="text" name="state" size="3"/>
Phone: <input type="text" name="phone" size="15"/>
</p>
<p>
Account Balance: <input type="text" name="acct_balance" size="13"/>
</p>
<p class="bttn">
<input class="b" type="submit" name="query" value="Insert Customer"/>
<input class="b" type="reset" name="reset" value="Clear Form"/>
</p>
</form>
插入客户.php:
$name = $_POST['name'];
$addr = $_POST['address'];
$city = $_POST['ccity'];
$state = $_POST['cstate'];
$phone = $_POST['phone'];
$acct_balance = $_POST['acct_balance'];
代码有问题吗?我已按照本文中提到的所有步骤进行操作,但每次单击提交按钮时,它都会下载 php 文件。我提前道歉,因为我对 php 还很陌生。