Recommended: Design the login module for ASP users User login verification script, Chkpwd.asp The following is the referenced content: % '========= User login verification script====== 'If the Passed object is not defined yet, it is defined as false, indicating that there is no
This program places the number of the counter in the ACCESS database, and of course you can also use other ODBC data sources you want. This program reads the count information from the URL. As follows:
< IMG src=id=MYTEST&seq=default&cells=7 >
parameter
id
Peugeot (i.e. username) of the client web page. Every time you use a new ID, a new record will be inserted into the database. If this ID exists, its count will be increased by 1. If you do not want the client to automatically start an ID and need to register, then you will assign the value automatically inserted to False.
seq
Optional. Used to select the style of the counter image. The name of the image displayed on the client is .gif. The default value is defalut.gif, and this defalut.gif must be placed in the current working directory!
cells
Optional. The number of bits displayed in the count result is 5 bits (you can adjust this value in the program) How to run this program
Copy this program to where you want it on the server.
Create a data source Webcounter. There must be a table name in this data source main, and the following are the fields in this table:
The following is the quoted content:
< table border=1 cellpadding=3 cellpacing=1 >
< tr >
< th >Field< /th >
< th >Type< /th >
< th >Indexed< /th >
< th >Means< /th >
< /tr >
< tr >
< td >ident< /td >
< td >AutoNumber</td>
< td >Yes< /td >
< td >For your needs</td >
< /tr >
< tr >
< td >id< /td >
< td >Text< /td >
< td >Yes< /td >
< td >username</td>
< /tr >
< tr >
< td >count< /td >
< td >Number< /td >
< td >No< /td >
< td >Counting numbers< /td >
< /tr >
< /table >
Assign a permission to the database if needed
Create a directory that stores GIF graphics, and place at least a default.gif graphics group in this directory. Give permissions to this file as appropriate.
Put some digital graphics in this directory that can be divisible by 10.
The following is the quoted content:
< table width=100% border=1 cellpacing=1 cellpadding=2 >
< tr >
< td bgcolor=#ccffff >File < b >counter.asp< /b > < /td >
< /tr >
< tr >
< td bgcolor=#ffffcc >< pre >
< %
Response.ContentType=image/gif
Response.Expires=0
'The directory where GIF bars are placed. Ends with /
workdir=c:/gifbars/
'Set this to False if you want to disable auto inserting
'new counter records to database on every hit with unique
'id string
auto_insert=True
id=Trim(Request.QueryString(id))
seq=Trim(Request.QueryString(seq))
if seq= then seq=default
cells=Trim(Request.QueryString(cells))
if cells= then cells=5 else cells=cells*1
set conn=Server.CreateObject(ADODB.Connection)
conn.Open Webcounter
sql=select count,ident from main where id=' & id & '
set rs=conn.Execute(sql)
if not rs.EOF then
count=rs(count) 1
ident=rs(ident)
rs.close()
conn.Execute(update main set count=count 1 where identity= & identity)
conn.close()
ShowNumbers()
else
rs.close()
if auto_insert=True and id< > then
conn.Execute(insert into main (id,count) values (' & id & ',1))
count=1
ShowNumbers()
end if
conn.close()
end if
Sub ShowNumbers()
set g=CreateObject(shotgraph.image)
filename=workdir & seq & .gif
if g.GetFileDimensions(filename,xsize,ysize,pal)< >1 then Exit Sub
xdigit=xsize/10
g.CreateImage xdigit*cells,ysize,UBound(pal) 1
g.InitClipboard xsize,ysize
g.SelectClipboard True
for i=0 to UBound(pal)
g.SetColor i,pal(i,0),pal(i,1),pal(i,2)
next
g.ReadImage filename,pal,0,0
for i=1 to cells
k=GetDigit(count,cells-i)
g.Copy (i-1)*xdigit,0,xdigit,ysize,k*xdigit,0,SRCCOPY
next
Response.BinaryWrite g.GifImage(-1,1,)
End Sub
Function GetDigit(number, position)
number1=number/(10^position)
tmp=number1/10
GetDigit=number1-tmp*10
End Function
% >
< xmp >
< /pre >
< /td >
< /tr >
< /table >
< hr >< /span >< /td >
< /tr >
< tr >
< td width=50% > < /td >
< td width=50% >< br >< /td >
< /tr >
< tr >
< td colspan=2 align=right >
< img border=0 src=images/bbstitle.gif >< a id=hlkAddMsg href=/AddMsg.aspx?id=234 style=color:red >Leave a comment< /a >
< img border=0 src=images/mail.gif >< a id=hlkMailTo href=/MailTo.aspx?id=234 >Mail this page< /a >
< img border=0 src=images/print.gif >< a href=javascript:window.print() >Print this page< /a >
< img border=0 src=images/profile.gif >< a href=javascript:void(null) onclick=if(!document.execCommand('SaveAs','show.aspx',1)) return false; >Save this page< /a >
< img border=0 src=images/ask.gif >< a href=bbs/index.asp >You have questions< /a >
< /td >
< /tr >
< tr bgcolor=#97B9FF >
< td width=50% >< b >< font color=#FFFFFF >Related articles< /font >< /b >< /td >
< td width=50% >< b >< font color=#FFFFFF >Related Comments< /font >< /b >< /td >
< /tr >
< tr >
< td width=50% valign=top >
< /td >
< td width=50% valign=top >
< /td >
< /tr >
< tr >
< td width=50% >
< /td >
< td width=50% align=right >< img border=0 src=images/more.gif >< a id=hlkRela >< /a >< /td >
< /tr >
< /table >
< /td >
< /tr >
< /table >
< /td >
< /tr >
< /table >
< /body >
< /html >
Share: A brief discussion on the principle of ASP acquisition program The main steps of the collection program are as follows: 1. Obtain the content of the collected page 2. Extract all the data from the acquisition code 1. Obtain the content of the collected page I currently know about ASP commonly used methods for obtaining the collected page: 1.