ls354 Posted May 14, 2007 Share Posted May 14, 2007 HI, I have been learning PHP from a book for some time, my problem is that I cant get PHP to display the number of items that were enter in orderform.html into processorder.php. Thanks for any help in advance, if I didnt explain my problem so well tell me. -------------------------------------------------------------------------------------- orderform.html -------------------------------------------------------------------------------------- <HTML> <HEAD> <TITLE>Order Form</TITLE> </HEAD> <BODY> <form action="processorder.php" method="post"> <table border="0"> <tr bgcolor="#cccccc"> <td width="150">Item</td> <td width="12">Quantity</td> </tr> <tr> <td>Tires</td> <td align="center"><input type="text" name="tireqty" size="3" maxlenght="3" /></td> </tr> <tr> <td>Oil</td> <td align="center"><input type="text" name="oilqty" size="3" maxlenght="3" /></td> </tr> <tr> <td>Sparks Plugs</td> <td align="center"><input type="text" name="sparkqty" size="3" maxlenght="3" /></td> </tr> <tr> <td colspan="2" align="center"><input type="submit" value="Submit Order" /></td> </tr> </table> </form> </BODY> </HTML> --------------------------------------------------------------------------------- processorder.php --------------------------------------------------------------------------------- <?php // create short variable names $tireqty = $_POST [ ' tireqty ' ] ; $oilqty = $_POST [ ' oilqty ' ] ; $sparkqty = $_POST [ ' sparkqty ' ] ; ?> <HTML> <HEAD> <TITLE>Bob's Auto Parts - Order Results</TITLE> </HEAD> <BODY> <h1>Bob's Auto PArts </h1> <h2>Order Results</h2> <?php echo '<p>Order processed at ' ; echo date ( ' H:i, jS F ' ) ; echo '</p>' ; echo ' <p>Your order is as follows: </p> ' ; echo $tireqty. ' tires<br /> ' ; echo $oil1qty. ' bottles of oil<br /> ' ; echo $sparkqty. ' spark plugs<br /> ' ; ?> </BODY> </HTML> Quote Link to comment https://forums.phpfreaks.com/topic/51282-solved-how-to-move-from-form-to-result-in-php/ Share on other sites More sharing options...
mmarif4u Posted May 14, 2007 Share Posted May 14, 2007 try this: processorder.php <?php // create short variable names $tireqty = $_POST ['tireqty'] ; $oilqty = $_POST ['oilqty'] ; $sparkqty = $_POST ['sparkqty'] ; ?> <HTML> <HEAD> <TITLE>Bob's Auto Parts - Order Results</TITLE> </HEAD> <BODY> <h1>Bob's Auto PArts </h1> <h2>Order Results</h2> <?php echo '<p>Order processed at ' ; echo date ( ' H:i, jS F ' ) ; echo '</p>' ; echo ' <p>Your order is as follows: </p> ' ; echo $tireqty. 'tires' ; echo "<br>"; echo $oilqty. 'bottles of oil' ; echo "<br>"; echo $sparkqty. 'spark plugs' ; ?> </BODY> </HTML> Quote Link to comment https://forums.phpfreaks.com/topic/51282-solved-how-to-move-from-form-to-result-in-php/#findComment-252588 Share on other sites More sharing options...
ls354 Posted May 15, 2007 Author Share Posted May 15, 2007 mmarif4u thank for taking the time to help, that solved my problem. Quote Link to comment https://forums.phpfreaks.com/topic/51282-solved-how-to-move-from-form-to-result-in-php/#findComment-254021 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.