当我提交此表单时,它会下载引用的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>
Insertcustomer.php:
$name = $_POST['name'];
$addr = $_POST['address'];
$city = $_POST['ccity'];
$state = $_POST['cstate'];
$phone = $_POST['phone'];
$acct_balance = $_POST['acct_balance'];
代码有问题吗?我已按照此article中提到的所有步骤进行操作,但每次单击提交按钮时,都会下载php文件。我提前道歉,因为我对php很新。
答案 0 :(得分:3)
<?php
和?>