日期:2014-05-16  浏览次数:20496 次

php提交表单后出现http500错误

新手,刚接触php,麻烦各位大神了
html部分
<html>
<head>
<title>Popcorn sales</title>
</head>
<body>
<form action="http://localhost/my_php1/Popcorn_sales.php" method="post">
<h2>Welcome to here!</h2>
<table>
<tr>
   <td>Buyer's Name:</td>
   <td><input type="text" name="name" size="30"/></td>
</tr>
<tr>
<td>Street Adress:</td>
<td><input type="text" name="street" size="30"/></td>
</tr>
<tr>
<td>City,State,Zip:</td>
<td><input type="text" name="city" size="30"/></td>
</tr>
</table>
<p>
<table border="border">
<tr>
<th>Product</th>
<th>Price</th>
<th>Quantity</th>
</tr>
<tr>
<td>Unpopped Popcorn(1 1b.)</td>
<td>$3.00</td>
<td align="center"><input type="text" name="unpop" size="3"/></td>
</tr>
<tr>
<td>Caramel Popcorn</td>
<td>$3.50</td>
<td align="center"><input type="text" name="caramel" size="3"/></td>
                </tr>
                <tr>
<td>Caramel Nut Popcorn(1 1b.)</td>
<td>$4.50</td>
<td align="center"><input type="text" name="caramelnut" size="3"/></td>
</tr>
<tr>
<td>Toffey Nut Popcorn(1 1b.)</td>
<td>$5.00</td>
<td align="center"><input type="text" name="toffeynut" size="3"/></td>
</tr>
</table>
</p>
<h3>Payment Method</h3>
<p>
<input type="radio" name="payment" value="visa" checked="checked"/>Visa<br/>
<input type="radio" name="payment" value="mastercard" checked="checked"/>Master Card<br/>
<input type="radio" name="payment" value="discover" checked="checked"/>Discover<br/>
<input type="radio" name="payment" value="check" checked="checked"/>Check<br/><br/>
    <input type="submit" value="Submit Order"/>
    <input type="reset" value="Submit Order"/>
</p>
</form>
</body>
</html>


php程序
<html>
<head>
<title>Process the popcorn.html form</title>
</head>
<body>
<?php
$unpop=$_post["unpop"];
$caramel=$_post["caramel"];
$caramelnut=$_post["caramelnut"];
$toffeynut=$_post["toffeynut"];
$name=$_post["name"];
$street=$_post["street"];
$city=$_post["city"];
$payment=$_post["payment"];
if($unpop=="") $unpop=0;
if($caramel=="") $caramel=0;
if($caramelnut=="") $carame