⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 payment.php

📁 六和投注系统
💻 PHP
字号:
<?php
session_start();
include("../inc/conn.php");
include_once($_SESSION["inclanguage"]);
include("check.php");
include("../inc/main.js.php");
function vf($sign)
{
global $conn;
$sqls=mysql_query("select * from config where sign='$sign'",$conn);
$p=mysql_result($sqls,0,"content"); 
return $p;
}
$sqlpay=mysql_query("select * from payinfo where sign='1'",$conn);

if(isset($_POST["pay"]))
{ 
//测试:将提交表单中的paymode值设为testmode即可进入支付平台测试模式。
$reg_userid=mysql_result($sqlpay,0,"conum"); //商户编号
$reg_key=mysql_result($sqlpay,0,"md5num");//商户密钥
//会员名称,长度:50
$servicename=$_POST["user_account"];
$Currency=1; //币种
//支付金额,以元为单位。
$amount=$_POST["money"]*100;
//贺喜支付平台支付接口支付结果返回地址设置,请修改成自己的接收网址。
$receive_url="http://".mysql_result($sqlpay,0,"siteurl")."/opuser/payreceive.php";
$bankinterface=mysql_result($sqlpay,0,"payinterface");
//订单日期,长度:8
$ymd=date('Ymd',time());//不可为空值,长度为8位,格式为yyyymmdd

//商户订单号,可自定义
$billno=date('YmdHis',time());//30个字符以内,必填

//自定义字段,请在生成加密字符串之前设置好custom1、custom2,custom1name和custom2name是在支付平台显示的自定义字段名称,这里设置为空值,商户可自行设置。
$custom1name=$_POST["custom1name"];
$custom1=$_POST["custom1"];
$custom2name=$_POST["custom2name"];
$custom2=$_POST["custom2"];
//选择的支付途径,1:银行卡支付,2:声讯电话支付,3:互联星空支付,4:手机短信注册,5:腾讯财付通支付,6:腾讯Q币支付,7:神州行充值卡支付,8:盛大游戏点卡支付,9:支付宝支付,10:手机银行支付,11:北京宽带支付,12:联通充值卡支付。
$payvia=$_POST["paytype"];
//运行模式,不启用测试模式可不设置此变量,将paymode值设为testmode即可进入支付平台测试模式。
$paymode='';
//拼凑串为:商户编号+amount+ymd+receive_url+billno+custom1+custom2+payvia+商户密钥+paymode
$post_key=$reg_userid.$amount.$ymd.$receive_url.$billno.$custom1.$custom2.$payvia.$reg_key.$paymode;
//strtoupper函数是将字符转换为大写
//贺喜支付平台支付接口对MD5值只认大写字符串,所以小写的MD5值得转换为大写
$post_md5info=strtoupper(md5($post_key));
$times=date("Y-m-d H:i:s");
if($payvia==1) $Remark=$pn_netbankpay;
if($payvia==7) $Remark=$pn_czmobille;
 if($payvia==10) $Remark=$pn_ponebankpay;
$money=$amount/100;
$ok=mysql_query("insert into payment(order_number,user_account,money_type,money,remark,times,succeed,result)values('$billno','$servicename','$Currency','$money','$Remark','$times','失败','失败')",$conn);
if($ok)
{
?>
<head>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<link href="../styles/css_g/css2.CSS" rel="stylesheet" type="text/css">
<title><?=vf(1)?> <?=$pn_payinfoconfirm?></title>
<style type="text/css">
<!--
 body {
	margin-left: 8px;
	margin-top: 0px;
	margin-right: 10px;
	background-color: yellow;
}
-->
</style></head>
<script language="javascript">
function fs()
{
    reform.fsubmit.disabled=true;
	setTimeout("window.location='buy_lottery.php';",5000);
    return true;
}
</script>
<body onLoad="show5();"> 
<table width="95%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="5" ></td>
  </tr>
</table>
<?php include("../inc/linemsg.php");?>
<table width="95%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="5" ></td>
  </tr>
</table>
<table width="688" height="24"  border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="1%" height="24"><img src="../styles/nimg/menu_l.gif" width="10" height="29"></td>
    <td width="97%" valign="bottom" background="../styles/nimg/menu_c.gif"><table width="100%" height="19"  border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="13%" class="fw12"><?=$pn_buylottery?></td>
          <td width="41%" nowrap></td>
          <td width="44%" align="right" nowrap><div id="liveclock"> </div></td>
          <td width="2%">&nbsp;</td>
        </tr>
    </table></td>
    <td width="2%"><img src="../styles/nimg/menu_r.gif" width="10" height="29"></td>
  </tr>
</table>
<table width="685" height="290"  border="0" cellpadding="0" cellspacing="1" class="t11">
  <tr>
    <td  valign="top" class="t20"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
           <tr>
            <td height="30" valign="top" class="t20"><span class="fb12"><img src="../images/Internetpay.jpg" width="173" height="72"></span></td>
          </tr>
          <tr>
            <td valign="top" bgcolor="#FFFFFF"><table width="558" height="171" border="0" align="center">
             <form action="<?=$bankinterface?>" method="post" target="_blank" name="reform" onSubmit="return fs();"> <tr align="center">
                <td colspan="2"><strong><?=$pn_nowpayinfo?></strong></td>
                </tr>
               <tr>
                 <td height="26" align="right"><?=$pn_ordernumber?>:</td>
                 <td><?php echo $billno;?></td>
               </tr>
               <tr>
                 <td height="21" align="right"><?=$pn_paytype?>:</td>
                 <td><?=$Remark?></td>
               </tr>
               <tr>
                 <td height="27" align="right"><?=$pn_ordermoney?>:</td>
                 <td><?php echo $money;?>
<?=$pn_rmb?></td>
               </tr>
               <tr>
                <td align="right">
                  <?=$pn_payaccount?>:</td>
                <td width="292"><?=$servicename?>
                 <input type=hidden name="reg_userid" value="<?php echo $reg_userid;?>">
<input type=hidden name="servicename" value="<?php echo $servicename;?>">
<input type=hidden name="amount" value="<?php echo $amount;?>">
<input type=hidden name="ymd" value="<?php echo $ymd;?>">
<input type=hidden name="receive_url" value="<?php echo $receive_url;?>">
<input type=hidden name="billno" value="<?php echo $billno;?>">
<input type=hidden name="custom1name" value="<?php echo $custom1name;?>">
<input type=hidden name="custom1" value="<?php echo $custom1;?>">
<input type=hidden name="custom2name" value="<?php echo $custom2name;?>">
<input type=hidden name="custom2" value="<?php echo $custom2;?>">
<input type=hidden name="paymode" value="<?php echo $paymode;?>">
<input type=hidden name="payvia" value="<?php echo $payvia;?>">
<input type=hidden name="post_md5info" value="<?php echo $post_md5info;?>"></td>
              </tr><!--
              <tr>
                <td align="right">商品名称:</td>
                <td><?=$Remark?></td>
              </tr>-->
              <tr align="center">
                <td colspan="2"><input type="submit" name="fsubmit" value="<?=$pn_paynextinfo?>"></td>
              </tr> </form>
            </table></td>
          </tr>
       
    </table></td>
  </tr>
</table>
</BODY>
<? 
 }else echo "<script language=javascript>alert('".$pn_systemerror."!');window.location='buy_lottery.php';</script>";
    }else echo "<h1>".$pn_payconfirmagain."...</h1>";?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -