Posting Value Problem
Posted: Wed May 11, 2005 9:58 am
Got a problem. The hidden vlaues from the form are not being passed onto the next page. When i do a var_export on the next page the values returned are NULL. Any Idea?
Code: Select all
<?
function display_outstanding_orders($order_array)
{// used to display the outstanding orders
if(!is_array($order_array))
{
echo 'No outstanding orders<br />';
return;
}
{
?>
<script type="text/javascript">
function checkIt(){
if(confirm("Cancel Order?")){
document.getElementById("MyForm").submit();
}
}
</script>
<table bgcolor="#7b9815" border="0" bordercolor="FFFFFF" cellpadding="0" cellspacing="0">
<th width="425">Outstanding Orders</th>
</table>
<br>
<table bgcolor="#7b9815" border="1" bordercolor="FFFFFF" cellpadding="0" cellspacing="0">
<font color="#000000" size="1" face="Arial, Helvetica, sans-serif"><th>Order Date</th><th>Item</th><th>Price</th><th>Status</th></font>
<?
}
foreach ($order_array as $row)
{//while an order still exists in the array loop round and display again.
$url = 'show_vinyls.php?cat_no='.($row['cat_no']);
$title = $row['title'];
$price = $row['price'];
$order_date = $row['date_order_placed'];
$status = $row['order_item_status'];
$cat_no = $row['cat_no'];
$order_id = $row['order_id'];
{
?> <tr>
<?
}
print '<tr>';
print '<td>';
echo $row['date_order_placed'];
echo '</td>';
//echo '<td>';
print do_html_url($url,$title);
echo '</td>';
echo '<td>';
echo $row['price'];
echo '</td>';
echo '<td>';
echo $row['order_item_status'];
echo '</td>';
echo '<td>';
echo '<form id="MyForm" action="cancelorder.php" method="post">';
echo '<input type="hidden" name="cat_no" value="'.$row['cat_no'].'">';
echo '<input type="hidden" name="order_id" value="'.$row['order_id'].'">';
echo '<input type="button" value="Cancel Order" onClick="checkIt();"> ';
echo '</form>';
echo '</td>';
echo '</tr>';
}
echo '</table>';
}?>