0
我想在更改下拉列表中的选项时更新数据库的值。上调后ctrl重定向回订单页面。现在更新工作正常,但无法恢复到订单页面。我为此使用了以下代码。如何解决错误,同时在禅车中从一个页面重定向到另一个页面
代码orders.php
<select name="order_status" onchange="update(this.value,<?php echo $row['orders_id'];?>)">
<option value="1" <?php if($row['orders_status']=='1'){ ?>selected="selected"<?php } ?>>In process</option>
<option value="2"<?php if($row['orders_status']=='2'){ ?>selected="selected"<?php } ?>>Processed</option>
<option value="3"<?php if($row['orders_status']=='3'){ ?>selected="selected"<?php } ?>>Dispatched</option>
</select>
<script>
function update(vals,order){
window.location="index.php?main_page=orders&val="+vals+"&id="+order;
}
</script>
<?php
if(($_REQUEST['id']) && ($_REQUEST['val'])){
$manufacturers = $db->Execute("update orders set orders_status = '{$_REQUEST['val']}'
where orders_id ='{$_REQUEST['id']}'");
if($manufacturers == '1'){
zen_redirect(zen_href_link('orders', '', $request_type));
}
}
>
...错误是? – 2012-04-27 10:58:26