日期:2014-05-17 浏览次数:20481 次
<table width="500" height="200" align="center" name="tijiaoding"> <tr><td>收货人:</td><td><input type="text" name="shouhuo"></td></tr> <tr><td>收货地址:</td><td><input type="text" name="address"></td></tr> <tr><td>邮编:</td><td><input type="text" name="postcode"></td></tr> <tr><td>电话:</td><td><input type="text" name="address"></td></tr> <?php $o_num=date('Ymdhis'); //生成订单号?> <tr><td> <a href="./pay.php?o_num=<?php echo $o_num ?>" name="tijiaoding"><img src="../image/tijiaoding.jpg" name="tijiaoding"></img></a><td></td></tr> </table> </form> <?php if(isset($_POST['tijiaoding'])){ //if($_SESSION['user']) //{ $user=$_SESSION['user'][1]; if($_POST['shouhuo']){ $shouhuo=$_POST['shouhuo']; $address=$_POST['address']; $postcode=$_POST['postcode']; phone=$_POST['phone']; $_SESSION['user']=array_push($_SESSION['user'],$o_num,$sum); $ding="insert into ord(o_id , o_num , coun , u_name , u_phone , u_address , postcode , ordertime , send , pay ) values('','$o_num', '$sum','$user','$phone','$address','$postcode',NOW(),'','',)"; $in_ord=mysql_query($ding); if($in_ord){ go("pay.php"); } else echo "订单插入失败!"; } else echo "请输入收货信息!";
session_start();require_once '../db/conn.php';require_once '../util/util.php';echo "<pre>";// print_r($_SESSION);// print_r($_GET);// return ; $arr=$_SESSION["mycar"];//将session中的变量取出来 $o_num=$_GET['o_num'];foreach ($arr as $sk=>$sv){ // print_r($sv);// exit; $quer_ding="select * from ord where o_num='{$o_num}'"; print_r($quer_ding);exit; $re_ding=mysql_query($quer_ding)or die(mysql_error()); // print_r($re_ding);//exit; foreach ($re_ding as $k=>$v){ ?> <tr> <td><?php echo $v[1];?></td><td><?php echo $v[2];?></td><td><?php echo $v[3];?></td> <td><?php echo $v[4];?></td><td><?php echo $v[5];?></td><td><?php echo $v[7];?></td> <td><?php if($v[9]) echo "已付款"; else echo "未付款";?></td> </tr> <?php }}?>