Click_Ajax.asp
资源名称:eat.rar [点击查看]
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:4k
源码类别:
数据库编程
开发平台:
ASP/ASPX
- <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
- <% Option Explicit %>
- <!--#include file="FS_Inc/Const.asp" -->
- <!--#include file="FS_InterFace/MF_Function.asp" -->
- <!--#include file="FS_Inc/Function.asp" -->
- <%session.CodePage="936"%>
- <%
- Response.Buffer = True
- Response.Expires = -1
- Response.ExpiresAbsolute = Now() - 1
- Response.Expires = 0
- Response.CacheControl = "no-cache"
- response.Charset = "gb2312"
- Dim Conn,User_Conn,Click_Sql,Click_RS,strShowErr,Cookie_Domain
- Dim Server_Name,Server_V1,Server_V2
- Dim TmpStr,TmpArr
- Dim stype,SubSys,spanid
- TmpStr = "1"
- MF_Default_Conn
- MF_User_Conn
- Cookie_Domain = Get_MF_Domain()
- if Cookie_Domain="" then
- Cookie_Domain = "localhost"
- else
- if left(lcase(Cookie_Domain),len("http://"))="http://" then Cookie_Domain = mid(Cookie_Domain,len("http://")+1)
- if right(Cookie_Domain,1)="/" then Cookie_Domain = mid(Cookie_Domain,1,len(Cookie_Domain) - 1)
- end if
- ''防盗连
- Server_Name = Len(Request.ServerVariables("SERVER_NAME"))
- Server_V1 = Left(Replace(Cstr(Request.ServerVariables("HTTP_REFERER")),"http://",""),Server_Name)
- Server_V2 = Left(Cstr(Request.ServerVariables("SERVER_NAME")),Server_Name)
- if Server_V1 <> Server_V2 and Server_V1 <> "" and Server_V2 <> "" then
- response.Write("没有权限,请访问<a href=""http://"&Cookie_Domain&""">"&Cookie_Domain&"</a>.")
- response.End()
- end if
- stype = request.QueryString("type") 'ajax
- SubSys = request.QueryString("SubSys") 'SubSys
- spanid = NoSqlHack(request.QueryString("spanid"))
- if stype="" then stype="ajax"
- if stype<>"ajax" then response.Write("Error:type not is ajax!") : response.End()
- if SubSys="" then response.Write("Error:SubSys is null!") : response.End()
- if spanid="" then response.Write("Error:spanid is null!") : response.End()
- TmpArr = split(spanid,"_")
- if ubound(TmpArr)<>3 then response.Write("Error:spanid's _ is Err!") : response.End()
- spanid = TmpArr(3)
- select case SubSys
- case "NS"
- Conn.execute("Update FS_NS_News set Hits=Hits+1 where NewsID='"&spanid&"'")
- set Click_RS=Conn.execute("select Hits from FS_NS_News where NewsID='"&spanid&"'")
- if not Click_RS.eof then TmpStr = cstr(Click_RS(0))
- RsClose()
- case "DS"
- if request.QueryString("Get")="ClickNum" then
- set Click_RS=Conn.execute("select ClickNum from FS_DS_List where ID="&spanid&"")
- if not Click_RS.eof then TmpStr = cstr(Click_RS(0))
- RsClose()
- else
- Conn.execute("Update FS_DS_List set Hits=Hits+1 where ID="&spanid&"")
- set Click_RS=Conn.execute("select Hits from FS_DS_List where ID="&spanid&"")
- if not Click_RS.eof then TmpStr = cstr(Click_RS(0))
- RsClose()
- end if
- case "MS"
- Conn.execute("Update FS_MS_Products set Click=Click+1 where ID="&spanid&"")
- set Click_RS=Conn.execute("select Click from FS_MS_Products where ID="&spanid&"")
- if not Click_RS.eof then TmpStr = cstr(Click_RS(0))
- RsClose()
- case "SD"
- Conn.execute("Update FS_SD_News set Hits=Hits+1 where ID="&spanid&"")
- set Click_RS=Conn.execute("select Hits from FS_SD_News where ID="&spanid&"")
- if not Click_RS.eof then TmpStr = cstr(Click_RS(0))
- RsClose()
- case "HS" ''房产有三个表,还需要一个参数
- Conn.execute("Update FS_HS_Quotation set Click=Click+1 where ID="&spanid&"")
- set Click_RS=Conn.execute("select Click from FS_HS_Quotation where ID="&spanid&"")
- if not Click_RS.eof then TmpStr = cstr(Click_RS(0))
- RsClose()
- case "Log" '日志
- User_Conn.execute("Update FS_ME_Infoilog set Hits=Hits+1 where iLogID="&spanid&"")
- set Click_RS=User_Conn.execute("select Hits from FS_ME_Infoilog where iLogID="&spanid&"")
- if not Click_RS.eof then TmpStr = cstr(Click_RS(0))
- RsClose()
- case "PHOTO" '相册
- User_Conn.execute("Update FS_ME_Photo set Hits=Hits+1 where ID="&spanid&"")
- set Click_RS=User_Conn.execute("select Hits from FS_ME_Photo where ID="&spanid&"")
- if not Click_RS.eof then TmpStr = cstr(Click_RS(0))
- RsClose()
- case else
- response.Write("Error:"&SubSys&" is not found.")
- end select
- response.Write(TmpStr)
- ConnClose()
- Sub RsClose()
- Click_RS.Close
- Set Click_RS = Nothing
- end Sub
- Sub ConnClose()
- Set User_Conn = Nothing
- Set Conn = Nothing
- response.End()
- End Sub
- %>