帮忙把asp转换php,谢谢. 10
<%Err.Clearforstr_i=1toRequest.form.Countresponse.writeRequest.form.key(str_i)&"="&Re...
<%
Err.Clear
for str_i = 1 to Request.form.Count
response.write Request.form.key(str_i)&"="&Request.form(str_i)&"<br>"
vsendStr_txt=vsendStr_txt&"&"&Request.form.key(str_i)&"="&server.URLEncode(trim(Request.form(str_i)))
next
vtime= FormatDate(now())
userstr=md5(userid&password&email&vtime)
category=trim(request.form("category"))
productid=trim(request.form("productid"))
action=trim(request.form("action"))
response.write vtime
vsendStr="userid="&userid&"&userstr="&userstr&"&vtime="&vtime&vsendStr_txt
call posturl(vsendStr)
sub posturl(sendStr)
returncodevalue=""
strHttp = apiUrl & "?"&sendStr
set http = server.createobject("Microsoft.XMLHTTP")
http.open "POST",strHttp,False
http.send
If Err.Number = 0 Then
strReturn=cstr(Http.ResponseText)
http.Abort()
response.write "<p>返回结果:<p><textarea name='textarea' cols=90 rows=20>"&strReturn&"</textarea><p>"
else
response.write "调用接口失败"
end if
set Http = nothing
end sub
sub xmlvalue(vStrReturn)
Set readServer = server.CreateObject("Microsoft.XMLDOM")
flag = readServer.loadXML(vStrReturn)
if flag = true then
i = 0
while (i < readServer.documentElement.childNodes.length)
nodename = trim(readServer.documentElement.childNodes.item(i).nodename)
nodecontentvalue = trim(readServer.documentElement.childNodes.item(i).text)
Response.Write nodename & "="&nodecontentvalue&"<br>"
if nodename = "returncode" then
returncodevalue = cstr(nodecontentvalue)
end if
if returncodevalue="200" then
if nodename = "sucdate" then
sucdate = cstr(nodecontentvalue)
end if 展开
Err.Clear
for str_i = 1 to Request.form.Count
response.write Request.form.key(str_i)&"="&Request.form(str_i)&"<br>"
vsendStr_txt=vsendStr_txt&"&"&Request.form.key(str_i)&"="&server.URLEncode(trim(Request.form(str_i)))
next
vtime= FormatDate(now())
userstr=md5(userid&password&email&vtime)
category=trim(request.form("category"))
productid=trim(request.form("productid"))
action=trim(request.form("action"))
response.write vtime
vsendStr="userid="&userid&"&userstr="&userstr&"&vtime="&vtime&vsendStr_txt
call posturl(vsendStr)
sub posturl(sendStr)
returncodevalue=""
strHttp = apiUrl & "?"&sendStr
set http = server.createobject("Microsoft.XMLHTTP")
http.open "POST",strHttp,False
http.send
If Err.Number = 0 Then
strReturn=cstr(Http.ResponseText)
http.Abort()
response.write "<p>返回结果:<p><textarea name='textarea' cols=90 rows=20>"&strReturn&"</textarea><p>"
else
response.write "调用接口失败"
end if
set Http = nothing
end sub
sub xmlvalue(vStrReturn)
Set readServer = server.CreateObject("Microsoft.XMLDOM")
flag = readServer.loadXML(vStrReturn)
if flag = true then
i = 0
while (i < readServer.documentElement.childNodes.length)
nodename = trim(readServer.documentElement.childNodes.item(i).nodename)
nodecontentvalue = trim(readServer.documentElement.childNodes.item(i).text)
Response.Write nodename & "="&nodecontentvalue&"<br>"
if nodename = "returncode" then
returncodevalue = cstr(nodecontentvalue)
end if
if returncodevalue="200" then
if nodename = "sucdate" then
sucdate = cstr(nodecontentvalue)
end if 展开
1个回答
展开全部
汗,这么长,谁能做呢。给你段PHP的语法代码,很多你都能自己改了。
<?php
function rpHash($value) {
$hash = 5381;
$value = strtoupper($value);
for($i = 0; $i < strlen($value); $i++) {
$hash = (($hash << 5) + $hash) + ord(substr($value, $i));
}
return $hash;
}
?>
<?php
function rpHash($value) {
$hash = 5381;
$value = strtoupper($value);
for($i = 0; $i < strlen($value); $i++) {
$hash = (($hash << 5) + $hash) + ord(substr($value, $i));
}
return $hash;
}
?>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询