Jump to content

[SOLVED] noob php problem


tcpa41

Recommended Posts

Hello,i was playing around with php and noticed a strange problem i cannot solve,i think its because data from form.html Isn't written to $post array. Im getting Undefined index problem. Ty for all help in advance  :-\

form.html

<form action="processorder.php" method="POST">
<table border=”0”>
<tr bgcolor=”#cccccc”>
<td width=”150”>Item</td>
<td width=”15”>Quantity</td>
</tr>
<tr>
<td>Tires</td>
<td align=”center”><input type=”text” name=”tireqty” size=”3”
maxlength="3" /></td>
</tr>
<tr>
<td>Oil</td>
<td align=”center”><input type=”text” name=”oilqty” size=”3”
maxlength=”3” /></td>
</tr>
<tr>
<td>Spark Plugs</td>
<td align=”center”><input type=”text” name=”sparkqty” size=”3”
maxlength=”3” /></td>
</tr>
<tr>
<td colspan="2" align="center"><button type="submit" style="height: 25px; width: 100px"><strong>
SendIt</strong></button>
</td>
</tr>
</table>
</form> 

 

processorder.php

<?php
// create short variable names
$tires = $_POST["tireqty"];
$oil = $_POST["oilqty"];
$spark = $_POST["sparkqty"];
echo "<p>Your order is as follows: </p>";
echo $tires." tires<br />";
echo $oil." bottles of oil<br />";
echo $spark." spark plugs<br />";
?>

 

Link to comment
https://forums.phpfreaks.com/topic/158712-solved-noob-php-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.