to all u php wizards, help this amature. im trying to store the value of the selected list box in a hidden field. i dnt even know if this is possible. i can do it for a text field. the problem i have is that the status of an order should be able to get changed from pending to either processing or delivered, for that order.
<form action="update_orders.php" method="post">
Username: <?php echo $row['username']; ?><br>
Order ID: <?php echo $row['orderid']; ?><br>
<input type="hidden" name="orderid"
value="<?php echo $_POST['orderid']; ?>">
Total: <?php echo $row['total']; ?><br>
Order Date: <?php echo $row['order_date']; ?><br>
Order Status: <select name="Pending" size="1">
<option value="Sent"> Sent
<option value="Processing" selected="selected"> Pending
</select><br>
First Name: <?php echo $row['shipfirst']; ?><br>
Last Name: <?php echo $row['shiplast']; ?><br>
Address1: <?php echo $row['shipaddress1']; ?><br>
Address2: <?php echo $row['shipaddress2']; ?><br>
City: <?php echo $row['shipcity']; ?><br>
Post Code: <?php echo $row['shippost']; ?><br>
</select><br><br>
<input type="submit" name="submit" value="Update">
<input type="button" value="Cancel" onClick="history.go(-1);">
</form>
the follwing is the query its supposed to execute. i know that i havnt posted the orderstatus, so at the moment it changes this field in the db to blank for the order. but this is what i am having a problem with storing the selected index.
$query_update = "UPDATE orders SET
order_status = '". $_POST['order_status'] ."'
WHERE orderid = '". $_POST['orderid']."'";