ASP statistics file download code

Source: Internet
Author: User

Yesterday to help a friend wrote a simple, below I will be a step-by-step from the establishment of the database after the download and display statistics times bar.

First, the database structure is as follows.

Access database is used, there are two records, we only in the down.asp connection address is such as count.asp?id=1 can download statistics mateydb software, the following we look at count.asp file it.

<!--#include file= "inc/conn.asp"-->
<%
id = Request ("id")

If not IsNumeric (ID) or id = "" Then
Response.Write (' download failed, record does not exist! ') ("<script>alert"); History.back ();</script> ")
Response.End ()
Else
Db_connect ()
SQL = "SELECT * from Soft_count where id=" &id
Rs.Open sql,conn,1,3
If not rs.eof Then
Rs (3) =rs (3) +1
Rs.update
Response.Redirect (Rs (2))
Else
Response.Write (' download failed, record does not exist! ') ("<script>alert"); History.back ();</script> ")
End If
Call Closedb ()
End If

%>

Database connection I will not write, the statistical code is complete, the following to see the display file show.asp

<!--#include file= "inc/conn.asp"-->
<%
Db_connect ()
SQL = "SELECT * FROM Soft_count"
Set Rs =conn.execute (SQL)
Do as not rs.eof
Response.Write ("Software:" &rs (1) & "| Download: "&rs (3) &" Times <br> ")
Rs.movenext
Loop
%>

All right, we're done with our paperwork. Reprint please indicate from www.111cn.net/asp/asp.html

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.