ASP Query Data code

Source: Internet
Author: User


<%if request ("id") = "" Then
Response. Write "<script>alert" (' Sorry! You entered an illegal character '); Location.href= '. /';</script> '
Response.End
End If
Id=request ("id")
Set Rs=server. CreateObject ("Adodb.recordset")
Rs.Open "Select Web_open from Tgy where Username= '" &id& "", conn,1,1
If Rs.eof Then
Response. Write "<script>alert" (' Sorry! The site does not exist! '); location.href= '. /';</script> '
Response.End
End If
If RS ("Web_open") =0 Then
Response. Write "<script>alert" (' Sorry! The site is off! '); location.href= '. /';</script> '
Response.End
End If
Rs.close
%>
<%set User_rs=server. CreateObject ("Adodb.recordset")
User_rs.open "SELECT * from Tgy where username= '" &id& "", conn,1,3
Member_get=user_rs ("Member_get")
Webname=user_rs ("Web")
Pm=user_rs ("PM")
Qq=user_rs ("QQ")
Email=user_rs ("email")
Name1=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 request. Cookies ("id") = "" Then
User_rs ("Visit") =user_rs ("visit") +1
If User_rs ("jifen1") = "" Or IsNull (User_rs ("Jifen1")) Then
User_rs ("Jifen1") =0.1
Else
User_rs ("Jifen1") =user_rs ("Jifen1") +0.1
End If
Visit=user_rs ("visit")
End If
User_rs.update
Response. Cookies ("IP") =request. ServerVariables ("REMOTE_ADDR")
Response. Cookies ("id") =id
If User_rs ("VIP") =1 and User_rs ("Vipdate") >=date () Then
If User_rs ("weburl") = "" Or IsNull (User_rs ("Weburl")) Then
Response.Redirect "/cd4/?id=" &id& ""
Else
Response.Redirect "/" &user_rs ("Weburl") & "/?id=" &id& ""
End If
End If
Response. Cookies ("tgy_url") = "/cd/index.asp?id=" &id& ""
User_rs.close
Set user_rs=nothing

%>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.