<?php
// 公共函数定义
  function HexToStr($hex)
  {
     $string="";
     for ($i=0;$i<strlen($hex)-1;$i+=2)
         $string.=chr(hexdec($hex[$i].$hex[$i+1]));
     return $string;
  } 
  
  $payid = $_POST["m_orderid"];
  $amount = $_POST["m_oamount"];	
  $m_status = $_POST["Status"];
  $OrderInfo = $_POST["OrderMessage"];
  $signMsg = $_POST["digest"];
  $OrderInfo = HexToStr($OrderInfo);

  $key = "nps&!@#$";
  $digest = strtoupper(md5($OrderInfo.$key));

if ($digest == $digest) {
		
	if($m_status=="2") {	

			$PageMain=Insert_Back_value($payid,$amount);

	}else{

			$PageMain=err("支付失败!","member.php","");

	}

}else{
	
			$PageMain=err("签名认证错误!","member.php","");


}

?>
