熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> .NET編程 >> 正文

asp 查詢數據代碼

2022-06-13   來源: .NET編程 

  <%if request("id")="" then
responseWrite "<script>alert(對不起!你輸入了非法字符);location;</Script>"
responseend
end if
id=request("id")
set rs=serverCreateObject("adodbrecordset")
rsopen "select web_open from tgy where username="&id&""conn
if rseof then
responseWrite "<script>alert(對不起!該網站不存在!);location;</Script>"
responseend
end if
 if rs("web_open")= then
responseWrite "<script>alert(對不起!該網站處於關閉狀態!);location;</Script>"
responseend
end if
rsclose
%>
<%set user_rs=serverCreateObject("adodbrecordset")
 user_rsopen "select * from tgy where username="&id&""conn
 member_get=user_rs("member_get")
 webname=user_rs("web")
 pm=user_rs("pm")
 qq=user_rs("qq")
 email=user_rs("email")
 name=user_rs("name")
 province=user_rs("province")
 city=user_rs("city")
 visit=user_rs("visit")
 vip=user_rs("vip")
 adddate=user_rs("adddate")
 vip_url=user_rs("weburl")
 if  requestCookies("id")=""  then
 user_rs("visit")=user_rs("visit")+
 if user_rs("jifen")="" or isnull(user_rs("jifen")) then
 user_rs("jifen")=
 else
 user_rs("jifen")=user_rs("jifen")+
 end if
 visit=user_rs("visit")
 end if
 user_rsupdate
 responseCookies("ip")=requestServerVariables("REMOTE_ADDR")
 responseCookies("id")=id
 if user_rs("vip")= and  user_rs("vipdate")>=date() then
 if user_rs("weburl")="" or isnull(user_rs("weburl")) then
 responseredirect "/cd/?id="&id&""
 else
 responseredirect "/"&user_rs("weburl")&"/?id="&id&""
 end if
 end if
 responseCookies("tgy_url")="/cd/indexasp?id="&id&""
 user_rsclose
 set user_rs=nothing

  %>


From:http://tw.wingwit.com/Article/program/net/201311/14322.html
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.