日期:2014-05-16 浏览次数:20721 次
<%
set rs1=server.CreateObject("adodb.recordset")
sql1="select * from downcount where 项目编号="&request.querystring("id") & " and 用户编号="&session("id") & " and 下载项目编号="& rs("编号")
rs1.open sql1,conn,1,1
if rs1.eof then
xzcs1=0
else
xzcs1=rs1("累计下载次数")
end if
%>
<script language=javascript>
var cs;
function downloadcount(id,yhid,xmid)
{
if (window.ActiveXObject)
{
cs=new ActiveXObject("Microsoft.XMLHTTP");
}
else if (window.XMLHttpRequest)
{
cs=new XMLHttpRequest();
}
var my_url="t.asp?id="+id+"&yhid="+yhid+"&xmid="+xmid;
cs.open ("GET",my_url,false);
cs.send(null);
</script>
set rs1=server.CreateObject("adodb.recordset")
sql1="select * from downcount where 项目编号="&request.querystring("id") & " and 用户编号="&session("id") & " and 下载项目编号="& rs("编号")
rs1.open sql1,conn,1,1
if rs1.eof then
xzcs1=0
else
xzcs1=rs1("累计下载次数")
end if
'=======执行更新
conn.execute("update 累计下载次数="&xzcs1&" downcount where 项目编号="&request.querystring("id") & " and 用户编号="&session("id") & " and 下载项目编号="& rs("编号"))
'response.write sql
response.write count1'输出下载次数给ajax使用
var cs;
function downloadcount(id,yhid,xmid)
{
if (window.ActiveXObject)
{
cs=new ActiveXObject("Microsoft.XMLHTTP");
}
else if (window.XMLHttpRequest)
{
cs=new XMLHttpRequest();
}
var my_url="t.asp?id="+id+"&yhid="+yhid+"&xmid="+xmid+'&_dc='+new Date().getTime();//加时间戳防止IE缓存
cs.open ("GET",my_url,false);
cs.send(null);
alert(cs.responseText)//得到最新的下载统计