<?php
require_once("../../conn/conn.php");
require_once("../../conn/function.php");

$action=$_GET["action"];
if($action=="pay"){
	$genkey=gen_key(32);
	$money=round($_POST["fee"],2);
	$data="<form action='https://www.paypal.com/cgi-bin/webscr' method='POST' name='form_starPay' id='form' style='display:none'><input type='hidden' name='cmd' value='_xclick'><input type='hidden' name='business' value='".$C_paypal."'><input type='hidden' name='item_name' value='Recharge'><input type='hidden' name='item_number' value='".$genkey."'><input type='hidden' name='amount' value='".$money."'><input type='hidden' name='shipping' value='0'><input type='hidden' name='currency_code' value='USD'><input type='hidden' name='return' value='".gethttp().$D_domain."/member'><input type='hidden' name='notify_url' value='".gethttp().$D_domain."/pay/paypal/notify_url2.php'><input type='hidden' name='cancel_return' value='".gethttp().$D_domain."/member'><input type='hidden' name='invoice' value='".$genkey."'><input type='hidden' name='charset' value='utf-8'><input type='hidden' name='no_shipping' value='1'><input type='hidden' name='no_note' value='1'><input type='hidden' name='rm' value='2'><input type='hidden' name='on0' value='OID'><input type='hidden' name='os0' value='".$_SESSION["M_id"]."'><button>提交</button></form><script>document.getElementById('form').submit();</script>";
	echo $data;
}

?>