http://www.jcb6.com specializes in Alipay, Tenpay and instant payment. Website recharge is worry-free Supports any language system and instant payment.
- include_once ('../global.php');
- include_once ('../configs/website.inc.php');
- $syskey=$conf_arr['cfg_portalkey']; //The KEY set in the background is compared with the key value of the interface address on the software
- $out_trade_no=$_GET['name']; //[Username] on the software and [Payment Instructions] in Alipay transactions are equivalent to those on the website Recharge order
- $key=trim($_GET['key']);//The key on the interface is equal to the backend key before logical processing is performed to ensure safety
- $money=$_GET['money'];//Equivalent to Payment amount in transaction
- if($out_trade_no!=''){
- if($key==$syskey){
- $sql="select * from ke_order where out_trade_no='$out_trade_no' limit 1";
- $result =mysql_query($sql);
- $total = mysql_num_rows($result);
- $row=mysql_fetch_assoc($result);
- if($total==0){
- echo '0'; exit(); //Prevent Submitted maliciously
- }else{
- if($row['statu']==0){//Check whether it has been processed first, if not, continue
- $email=$row['email'];$mktime =mktime();
- if($email!==""){
- mysql_query("update `ke_member`set amount=amount+$money where username='$email'"); //Add money to the membership table
- mysql_query( "update `ke_order`set statu=1,money=$money where out_trade_no='$out_trade_no'"); //Change the recharge order information
- }
- echo '1';exit(); //Return 1 after the software receives it Displays that the recharge is successful and returns 0. After the software receives it, it displays that the recharge failed
- }else{
- echo '0';exit(); //If the order has been processed, that is, it has been credited, exit to prevent repeated crediting
- }
- }
- }
- }else{
- echo '0';exit();
- }
- ?>
Copy code
|