Schlo_50 Posted October 17, 2007 Share Posted October 17, 2007 Hi there, I need help in getting some form values from my price list back into my ms access database. I have so far been trying to get all selected check boxes on the page, quantity text fields and ordernotes text area to INSERT INTO my database but to no avail. Im using OBDC to add to the confusion. I've tried to develop my 'product' script into some kind of a form, but now need to find out how to make the data i want variable so that i can send them into my database. Product.php <form action="?id=inc/order" method="post" name="orderform"> <?php include('odbc.php'); $sql = odbc_exec($odbc, "SELECT * FROM Product1 ORDER BY CategoryName") or die (odbc_errormsg()); $prevCat=''; while($row = odbc_fetch_array($sql)) { $Category = $row["CategoryName"]; $ProductId = $row["ProductId"]; $ProductName = $row["ProductName"]; $Price = $row["Price"]; // has category changed // if so, print it if ($Category != $prevCat) { echo "<h2>$Category</h2>"; } echo 'Item Code: ', $ProductId, '<br/>Item Name: ', $ProductName, '<br/><br/>Price: £', $Price, ' | Order: <input name=checker type=checkbox /> Quantity: <input name=quan type=text maxlength=5 size=3 /><br/><br/>'; $prevCat = $Category; } ?> <hr /> (Order Notes- If you have any comments to make about any of the products you are ordering please state them below.)<br /> <textarea name="ordernotes" cols="75" rows="5"></textarea><br /><br /> <input name="submitBtn" type="Submit" value="Submit Order" /> </form> Any help would appreciated, or if you need any more information or questions please do PM me. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/73608-getting-form-values/ Share on other sites More sharing options...
Schlo_50 Posted October 17, 2007 Author Share Posted October 17, 2007 bump Quote Link to comment https://forums.phpfreaks.com/topic/73608-getting-form-values/#findComment-371471 Share on other sites More sharing options...
sasa Posted October 17, 2007 Share Posted October 17, 2007 change line echo 'Item Code: ', $ProductId, '<br/>Item Name: ', $ProductName, '<br/><br/>Price: £', $Price, ' | Order: <input name=checker type=checkbox /> Quantity: <input name=quan type=text maxlength=5 size=3 /><br/><br/>'; to echo 'Item Code: ', $ProductId, '<br/>Item Name: ', $ProductName, '<br/><br/>Price: £', $Price, ' | Order: <input name="checker[', $ProductId, ']" type="checkbox" /> Quantity: <input name="quan[', $ProductId, ']" type="text" maxlength="5" size="3" /><br/><br/>'; Quote Link to comment https://forums.phpfreaks.com/topic/73608-getting-form-values/#findComment-371477 Share on other sites More sharing options...
Schlo_50 Posted October 17, 2007 Author Share Posted October 17, 2007 Bump Quote Link to comment https://forums.phpfreaks.com/topic/73608-getting-form-values/#findComment-371663 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.