$.post('api/add_goods_list.php', $('form').serialize(), function(data) {
if (data.result == 'success') {
location.href = 'car_goods_list.php';
}
});form表单传值
$id = empty($_GET['id']) ? '' : trim($_GET['id']);
$goods = db_query("select * from car_goods where id = '$id'");
<div class="am-accordion-content am-form-inline">主营品牌:
<select name="brand" data-am-selected="{btnSize: 'xs', btnStyle: 'secondary', btnWidth: '180'}">
<option value="奥迪">奥迪</option>
<?php for ($i = 0, $count = count($arr); $i < $count; $i++) {
$brand = explode(',',$arr[$i]);
echo "<option value=" .$brand[2]. ">" .$brand[2]. "</option>" . "\n";
} ?>
</select>
</div>下拉列表
<input type="hidden" name="id" value="<?php echo $goods[0]['id']; ?>">(网页传值加入form表单)
网页中通过GET方法传值
<a href="car_goods_mod.php?id=<?php echo $goods[$i]['id']; ?>" class="am-list-item-hd"><?php echo $goods[$i]['title']; ?></a>
$id = empty($_GET['id']) ? '' : trim($_GET['id']);接受传过来的值得页面接收方式