<?php
if($_POST['action']=="alipay"){
$partner=$_POST['partner'];
$security_code=$_POST['security_code'];
$seller_email=$_POST['seller_email'];
$configStr1 = file_get_contents("../alipay/alipay_config.bak.php");//得到文件执行的结果
    $configStr1 = str_replace("~partner~",$partner,$configStr1);
	$configStr1 = str_replace("~security_code~",$security_code,$configStr1);
	$configStr1 = str_replace("~seller_email~",$seller_email,$configStr1);
$of = fopen('../alipay/alipay_config.php','w');//创建并打开dir.txt
if($of){
 fwrite($of,$configStr1);//把执行文件的结果写入文件
}
fclose($of);
echo "<script>alert('修改成功')</script>"; 
echo "<script>javascript:history.back();</script>";

}elseif($_POST['action']=="tenpay"){

$bargainor_id=$_POST['bargainor_id'];
$key=$_POST['key'];
$configStr1 = file_get_contents("../tenpay/index.bak.php");//得到文件执行的结果
    $configStr1 = str_replace("~bargainor_id~",$bargainor_id,$configStr1);
	$configStr1 = str_replace("~key~",$key,$configStr1);
$of = fopen('../tenpay/index.php','w');//创建并打开dir.txt
if($of){
 fwrite($of,$configStr1);//把执行文件的结果写入文件
}
fclose($of);

echo "<script>alert('修改成功')</script>"; 
echo "<script>javascript:history.back();</script>";
}

if($_POST['action']=="tenpay"){

$bargainor_id=$_POST['bargainor_id'];
$key=$_POST['key'];
$configStr2 = file_get_contents("../tenpay/index1.bak.php");//得到文件执行的结果
    $configStr2 = str_replace("~bargainor_id~",$bargainor_id,$configStr2);
	$configStr2 = str_replace("~key~",$key,$configStr2);
	print_r($configStr2);
$of1 = fopen('../tenpay/index1.php','w');//创建并打开dir.txt
if($of1){
 fwrite($of1,$configStr2);//把执行文件的结果写入文件
}
fclose($of1);
}
?>