日期:2014-05-17 浏览次数:20509 次
<form id='order' name='order' method='get' action='./jiesuan.php'>
<table width="500" height="200" align="center" name="formt">
<tr><td>收货人:</td><td><input type="text" name="shouhuo" id="shouhuo"></td></tr>
<tr><td>收货地址:</td><td><input type="text" name="address" id="address"></td></tr>
<tr><td>邮编:</td><td><input type="text" name="postcode" id="postcode"></td></tr>
<tr><td>电话:</td><td><input type="text" name="phone" id="phone"></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" ></img></a>
<td><input type="button" id="mys" name="mys" value="mys"></td>
</tr>
</table>
</form>
<script type="text/javascript">
<!--
function s(){
var xmlhttp = new XMLHttpRequest();
var url = "pay.php?shouhuo="+$("shouhuo").value+"&address="+$("address").value+"&postcode="+$("postcode").value+"&phone="+$("phone").value;
alert("已提交");
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
window.location.reload();
// location.href="pay.php";
}
$("mys").onclick = s;
function $(id){
return document.getElementById(id);
}
//-->
</script>
<?php
if($_POST){
//if($_SESSION['user'])
//{
$user=$_SESSION['user'][1];
// if($_POST['shouhuo']){
$shouhuo=$_POST['shouhuo'];
$address=$_POST['address'];
$postcode=$_POST['postcode'];
$phone=$_POST['phone'];
$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(),'','',)";
if(mysql_query($ding,$conn))
go("pay.php");
foreach ($arr as $k=>$v){
}
// }
// else
// echo "请输入收货信息!";
//}
//else
// echo "请<a href='../vip.php'>登录>></a>!";
}
?>