请教高手:flash 执行 asp文件 相同服务中可以执行,不同服务就执行不了
请flash 高手和asp高手帮看一下现在这代码那里错了。原因是:
这代码当flash和asp文件在同一个服务器上可以执行也没有出错,但是当flash和asp分别分开在两个不同的服务器上就执行不了。
请问一下有那位高手可以指点一下呀?
在此谢了。
flash代码:
on (release) {
var result_lv:LoadVars = new LoadVars();
var send_lv:LoadVars = new LoadVars();
send_lv.username="cak"
send_lv.lurl="网址"
send_lv.dianji=1
send_lv.sendAndLoad("guangao.asp", result_lv, "POST");
result_lv.onLoad = function(success) {
if (success) {
trace(result_lv.ret);//收到返回的传,比如php是这样写的echo "ret=ok";那么这里就会的得到ok字符.
} else {
trace("连接到服务器失败");
}
};
}
guangao.asp 代码:
Private Function getIP()
Dim strIPAddr
If Request.ServerVariables("HTTP_X_FORWARDED_FOR") = "" OR InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), "unknown") > 0 Then
strIPAddr = Request.ServerVariables("REMOTE_ADDR")
ElseIf InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ",") > 0 Then
strIPAddr = Mid(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), 1, InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ",")-1)
ElseIf InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ";") > 0 Then
strIPAddr = Mid(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), 1, InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ";")-1)
Else
strIPAddr = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
End If
getIP = Trim(Mid(strIPAddr, 1, 30))
End Function
%>
<%
Dataname="#syzl.mdb"
Set conn = Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(dataname)
conn.Open connstr
dianji=0
nameid=year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)
username=Request("username")'"王"'广告名
lurl=Request("lurl")'Request.ServerVariables("HTTP_REFERER")'广告网址
lip=getIP()'Request.ServerVariables("Remote_HOST")
dianji=cint(Request("dianji"))'1 '是否点击
ldate=now()
datetime=date()
if datetime<>"" and lip<>"" then
set rsCou = Server.CreateObject("ADODB.Recordset")
rql="select * from webcount where lip='"&lip&"' and datetime=#"&datetime&"#"
rsCou.Open rql,conn,3,3
if not(rsCou.bof and rsCou.eof) then
rsCou("llanxu")=rsCou("llanxu")+1 '更新浏览量
if request.Cookies("dates")="" then
rsCou("ldate")=now() '浏览时间
response.Cookies("dates")=now()
end if
rsCou("jdate")=now()
else
rsCou.AddNew
rsCou("nameid")=nameid '广告ID
rsCou("username")=username'广告名称
rsCou("lurl")=lurl '广告网址
rsCou("lip")=lip '广告IP
rsCou("llanxu")=1 '浏览量
end if
rsCou.Update
rsCou.Close
end if
if cint(dianji)=1 then
if datetime<>"" and lip<>"" then
set rsCou = Server.CreateObject("ADODB.Recordset")
rql="select * from webcount where lip='"&lip&"' and datetime=#"&datetime&"#"
rsCou.Open rql,conn,3,3
if not(rsCou.bof and rsCou.eof) then
rsCou("dianji")=rsCou("dianji")+1'统计点击量
rsCou("jdate")=now() '更新点击时间
end if
rsCou.Update
rsCou.Close
end if
end if
%>
<script language="JavaScript" type="text/javascript">
function window.onunload() {
<%
if datetime<>"" and lip<>"" then
set rsCou = Server.CreateObject("ADODB.Recordset")
rql="select * from webcount where lip='"&lip&"' and datetime=#"&datetime&"#"
rsCou.Open rql,conn,3,3
if not(rsCou.bof and rsCou.eof) then
rsCou("jdate")=now()'更新最后浏览时间
rsCou("jintime")=rsCou("jintime")+datediff("s",rsCou("ldate"),now())'浏览总时间
end if
rsCou.Update
rsCou.Close
end if
%>
}
</script>