Home > php教程 > php手册 > 自动跳转支付宝和财付通并填表的函数

自动跳转支付宝和财付通并填表的函数

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 19:39:46
Original
1343 people have browsed it

自动跳转支付宝和财付通并填表的函数,就是这样,已集合在Ben框架中。 稍作补充,参数1是类型,1表示支付宝,2表示财付通。 参数2是收款人账户,参数3是金额,参数4是备注标题,参数5是备注内容(支付宝) ?phpfunction pay($type=1,$user='1272294450@qq.co

自动跳转支付宝和财付通并填表的函数,就是这样,已集合在Ben框架中。
稍作补充,参数1是类型,1表示支付宝,2表示财付通。
参数2是收款人账户,参数3是金额,参数4是备注标题,参数5是备注内容(支付宝)

<?php
function pay($type=1,$user='1272294450@qq.com',$money=1,$title="来自Ben框架捐助",$note='来自Ben框架捐助辣'){
$pay1=$user;
$pay2=$user;
if($type==1){
?>
<html>
<head>
<meta charset="utf-8">
<title>正在跳转...</title>
</head>
<body>
<form accept-charset="gb2312" id="alipaysubmit" name="alipaysubmit" action="https://shenghuo.alipay.com/send/payment/fill.htm" method="POST">
  <input type="hidden" name="optEmail" value="<?php echo $pay1;?>">
  <input type="hidden" name="payAmount" value="<?php echo $money;?>">
  <input type="hidden" name="title" value="<?php echo $title;?>">
  <input type="hidden" name="memo" value="<?php echo $note;?>">
  <input type="hidden" value="submit" value="sending...click here...">
</form>
<script type="text/javascript">
   document.forms['alipaysubmit'].submit();
</script>
</body>
</html>
<?php
}
if($type==2){
$md5=md5($pay2."&".$money."&".$title);
?>
<html>
<head>
<meta charset="utf-8">
<title>正在跳转...</title>
</head>
<body>
<form id="alipaysubmit" action="https://www.tenpay.com/v2/account/pay/paymore_cft.shtml?data=<?php echo $pay2;?>%26<?php echo $money;?>%26<?php echo $title;?>&validate=<?php echo $md5;?>" method="post">
<input type="hidden" value="submit" value="sending...click here...">
</form>
<script type="text/javascript">
   document.forms['alipaysubmit'].submit();
</script>
</body>
</html>
<?php
}}
?>
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template