アリペイ契約免除手数料支払いインタフェースAPI
31378 ワード
アリペイ契約免除手数料支払いインタフェースAPI
PHPの友达はこの原理を理解することができて开発したい自分が开発することができることを见て1つのありがとうございます支持
データベース接続
PHPの友达はこの原理を理解することができて开発したい自分が开発することができることを见て1つのありがとうございます支持
データベース接続
- // PHP
- // mysql
- require_once ('mysql.class.php');
- //
- define("host","localhost"); //
- define("user","root"); //
- define("pwd","123456"); //
- define("dbname","qz"); //
-
- $mysql = new MySQL(host,user,pwd,dbname);
- @mysql_query("set names 'utf8'");
PHP API
- header('Content-type: text/html; charset=utf8');
- $sel=require 'db.php'; //
- @mysql_query("set names 'utf8'");
- date_default_timezone_set('Asia/Shanghai');
- $time=date('Y-m-d H:i:s',time());
-
- // GET
- $us=htmlspecialchars($_GET['us'],ENT_NOQUOTES);//
- $pw=htmlspecialchars($_GET['pw'],ENT_NOQUOTES);//
- $out_trade_no=htmlspecialchars($_GET['out_trade_no'],ENT_NOQUOTES);//
- $subject=htmlspecialchars($_GET['subject'],ENT_NOQUOTES);//
- $total_fee=htmlspecialchars($_GET['total_fee'],ENT_NOQUOTES);//
- $pay_time=htmlspecialchars($_GET['pay_time'],ENT_NOQUOTES);//
-
- //
- if($us!==" "){exit($time." ");}
- if($pw!==" "){exit($time." ");}
-
- // , , , ,
- $select_out_trade_no=$mysql->table('xz_pay')->where('out_trade_no='.$out_trade_no)->select();
- if(!$select_out_trade_no){
-
- //
- $arr['out_trade_no'] = $out_trade_no;
- $arr['subject'] = $subject;
- $arr['total_fee'] = $total_fee;
- $arr['pay_time'] = $pay_time;
- $sql_add=$mysql->data($arr)->table('xz_pay')->add();
- if($sql_add){echo $time." {$subject}- ";}else{echo $time." {$subject}- ";}
-
- // ( )
- //subject
- $select_subject=$mysql->table(' ')->where('subject='.$subject)->select();
- //
- if(!$select_subject){exit("- ");}
- //
- $update_subject=$mysql->table(' ')->data(array(' '=>' '))->where('id=XXX ')->update();
- if($update_subject){echo"- ";}else{echo"- ";}
- // SQL , ,
-
- $update_subject=$mysql->table(' ')->data(array(' '=>' '))->where('subject='.$subject)->update();
- if($update_subject){echo"- ";}else{echo"- ";}
-
- }