<!--#include file="conn.asp" -->
<!--#include file="inc/usdl.asp" -->
<%
 v_num="0123456789."
 v_mid=Trim(Request.Form("v_mid"))
 v_oid=Trim(Request.Form("v_oid"))
 v_amount=Trim(Request.Form("v_amount"))
 v_rname=Trim(Request.Form("v_rname"))
 v_remail=Trim(Request.Form("v_remail"))
 v_rtel=Trim(Request.Form("v_rtel"))
 v_rpost=Trim(Request.Form("v_rpost"))
 v_raddr=Trim(Request.Form("v_raddr"))
 v_rnote=Trim(Request.Form("v_rnote"))
 v_payname=Trim(Request.Form("v_payname"))
 userid=Trim(Request.Form("userid"))
 key=Trim(Request.Form("key"))
 
 jed=0
  if v_oid="" or len(v_oid)<>6 then
   Response.Write("订单号不能为空或订单号不正确")
   Response.end
   else
   for i=1 to len(v_oid)
    if instr(v_num,mid(v_oid,i,1))=0 then
	 Response.Write("订单号出错")
     Response.end
	end if
   next
  end if
  
  if v_amount="" then
  Response.Write("支付金额不能为空")
  Response.end
  else
  for i=1 to len(v_amount)
    if instr(v_num,mid(v_amount,i,1))=0 then
	 Response.Write("金额非法.")
     Response.end
	end if
	if mid(v_amount,i,1)="." then
	  jed=jed+1
	end if
   next
  end if
  if jed>1 then
   Response.Write("金额非法.")
   Response.end
  end if
'  if mid(v_amount,1,1)=0 then
  ' v_amount=mid(v_amount,2,len(v_amount-1))
 ' end if
  if instr(v_amountm,".")<>0 then
    sss=instr(v_amountm,".")
	
  end if
  
dim md5string 
set md=server.CreateObject ("md5_VB.md5class")
poststring=v_mid&v_oid&v_amount
md5string=md.hmac(cstr(poststring),cstr(key))
 
  'Response.Write md5string
 sql="select * from pay"
 application lock
 rs.open sql,conn,2,3
  rs.addnew
   rs("userid")=userid
   rs("v_oid")=v_oid
   rs("v_amount")=v_amount
   rs("v_pstatus")=false
  rs.update
 rs.close
 application unlock
 %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>在线支付</title>
</head>
<body>
<% 
 'Response.Write v_mid &"<br>"
 'Response.Write v_oid&"<br>"
 'Response.Write v_amount&"<br>"
 'Response.Write key&"<br>"
 'Response.Write v_remail&"<br>"
 'Response.Write v_rtel&"<br>"
 'Response.Write v_rpost&"<br>"
 'Response.Write v_raddr&"<br>"
 'Response.Write v_rnote&"<br>"
 'Response.Write v_payname&"<br>"
 'Response.Write v_md5&"<br>"
 'Response.Write md5string&"<br>"
 %>
<form name="frm1" method="post" action="http://bank.ipay.com.cn/ipay.php">
<input type=HIDDEN name="v_mid"    value="<%=v_mid%>"> 	
<input type=HIDDEN name="v_oid"    value="<%= v_oid%>">  	
<input type=HIDDEN name="v_amount" value="<%= v_amount%>">  
<input type=HIDDEN name="v_rname"  value="<%= v_rname%>">
<input type=HIDDEN name="v_remail" value="<%= v_remail %>">
<input type=HIDDEN name="v_rtel"   value="<%= v_rtel %>">
<input type=HIDDEN name="v_rpost"  value="<%= v_rpost %>">
<input type=HIDDEN name="v_raddr"  value="<%= v_raddr%>">
<input type=HIDDEN name="v_rnote"  value="<%= v_rnote%>">
<input type=HIDDEN name="v_payname"value="<%= v_payname  %>">
<input type=HIDDEN name="v_md5"    value="<%= md5string%>">
  支付金额为:<%= v_amount %> 
  <input type="submit" name="Submit" value="确定">
</form>
<script language='JavaScript'>
  document.frm1.submit();
</script>

</body>
</html>




















