Recommended: A method to prevent irrigation and leave messages (randomly generated 4-digit authentication code) Principle: When each time you submit a message, you must enter a randomly generated 4-digit authentication code. The following code is used to generate a random 4-digit number in ASP: % dim key randomize timer key=Int((8999)*Rnd +1000) % Displayed in the form: Authentication code: %=key% input type=text name=rekey size=8 maxlength=4 input value=%=key
<%OptionExplicit
'database:
'location
'Table 1 Loaction is located in the city table
'Field
'loactionid (primary key)
'loactionname name
'Table 2District's county table
'Field
'locationid (primary key)
'districtid
'districtname
'Table 3. The townships where villages are located
'Field
'districtid(primary key)
'villageid
'villagename
%>
<html>
<head>
<title>List</title>
<metahttp-equiv=Content-Typecontent=text/html;charset=gb2312>
<%
dimconn
dimrs
dimsql
dimcount
dimrs1
dimsql1
dimrs2
dimsql2
dimcount2
dimconnstr
connstr=DBQ=+server.mappath(db11.mdb)+;DefaultDir=;DRIVER={Microsoft AccessDriver(*.mdb)};
setconn=server.createobject(ADODB.CONNECTION)
conn.openconnstr
sql=select*fromdirectorbylocationidasc
setrs=conn.execute(sql)
%>
<scriptlanguage=JavaScript>
varonecount;
onecount=0;
subcat=newArray();
<%
count=0
dowhilenotrs.eof
%>
subcat[<%=count%>]=newArray(<%=trim(rs(districtname))%>,<%=trim(rs(locationid))%>,<%=trim(rs(districtid))%>);
<%
count=count+1
rs.movenext
loop
rs.close
setrs=nothing
%>
Share: Asp generates static HTM list paging (including code, tested successfully) !--#include file=conn.asp-- htmlheadTITLE pagination test/TITLELINK href=inc/style.css type=text/css rel=stylesheet/head %strHead=strHeadhtml strHead=strHeadhead strHead=strHeadTITLE pagination test/TITLE strHead=strHeadLINK href=inc/style.cs
3 pages in total Previous page 123 Next page