![]() |
|
首页 │ Apache │ Linux│ Java│ MySQL│ 注册│帮助 | |||
以下的是ASP代码,因为本人水平太莱,搞不成功,望热心的高手帮助翻译成PHP!不胜感激!
<%
'接受程序--------------------------------------------------------------------------
myUserID=trim(request("myUserID"))
username=trim(request("username"))
cardID=trim(request("password"))
MobilePhone=trim(request("MobilePhone"))
ip=Request.ServerVariables("REMOTE_ADDR")
password=request("password")
action=request("action")
ServiceUrl=Request.ServerVariables("HTTP_REFERER")
mobile=MobilePhone
'。。。。。。。判断手机号码正确性。。。。。。。。。
'处理程序--------------------------------------------------------------------------
userNumber=MobilePhone '用户手机号
ip=Request.ServerVariables("REMOTE_ADDR")
if session("sValue") = "" then
sValue = 0
else
sValue = cint(session("sValue"))
end if
if isnumeric(userNumber) then
if len(cardID) > 0 then
PostUrl="http://www.text.com/tele.jsp?mobileNumber="&userNumber&"&f=662&feeCodeID=1&userIP="&ip&"®URL="&ServiceUrl&"&channelName=8002&cardID=" & cardID
Rvalue2=SendToSp23(PostUrl)
Rvalue2=Bytes2bStr34(Rvalue2)
Rvalue2 = Replace(Rvalue2,chr(10),"")
Rvalue2 = Replace(Rvalue2,chr(13),"")
Rvalue2 = Replace(Rvalue2,chr(32),"")
Rvalue2 = Trim(Rvalue2)
'if request("flag") = "1" then
'Rvalue2 = "0_5"
'end if
if left(Rvalue2,1) = "0" then
sValueCurrent = cint(Replace(Rvalue2,"0_",""))
session("sValue") = sValue + sValueCurrent
if sValue + sValueCurrent < 30 then
%>
<script LANGUAGE="JavaScript">
</script>
<%
else
%>
<script LANGUAGE="JavaScript">
</script>
<%
end if
else
%>
<script LANGUAGE="JavaScript">
</script>
<%
end if
end if
end if
sub alert(code)
if viewValue<>code then
printStr=Errinfo&"("&viewValue&"),请稍后再试!"
call printAlert(printStr,0)
end if
end sub
sub printAlert(printStr,isClose)
if isClose="1" then
cmd="window.close();"
else
cmd="history.go(-1);"
end if
response.Write "<script LANGUAGE=JavaScript>alert('"&printStr&"');"&cmd&"</script>"
response.End
end sub
Function SendToSp23(PostUrl)
Server.ScriptTimeOut=72000
Set oXMLHttp = createObject("Microsoft.XMLHTTP")
Call oXMLHttp.Open("get", PostUrl, false)
Call oXMLHttp.Send("")
sHtmlStr = oXMLHttp.responseBody
Set oXMLHttp = nothing
SendToSp23=sHtmlStr
End Function
Function Bytes2bStr34(p_sHtmlStr)
dim sReturnStr
dim i,n
sReturnStr = ""
n = LenB(p_sHtmlStr)
For i = 1 To n
dim sCharCode
dim sNextCharCode
sCharCode = AscB( MidB(p_sHtmlStr, i, 1) )
If (sCharCode < &H80) Then
sReturnStr = sReturnStr & Chr(sCharCode)
Else
sNextCharCode = AscB( MidB(p_sHtmlStr, i+1, 1) )
sReturnStr = sReturnStr & Chr(CLng(sCharCode) * &H100 + CInt(sNextCharCode))
i = i + 1
End If
Next
Bytes2bStr34 = sReturnStr
End Function
%>

