推荐:关于阻止灌水留言的一个方法(随机生成的4位认证码)原理:在每次提交留言的时候,要输入随机生成的4位认证码. 以下代码用在ASP 生成随机4位数: % dim key randomize timer key=Int((8999)*Rnd +1000) % 在表单里显示: 认证码:%=key% input type=text name=rekey size=8 maxlength=4 input value=%=key
<%OptionExplicit
’数据库:
’location
’表1loaction所在的市表
’字段
’loactionid(主键)
’loactionname名字
’表2district所在的县表
’字段
’locationid(主键)
’districtid
’districtname
’表3village所在的乡镇表
’字段
’districtid(主键)
’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={MicrosoftAccessDriver(*.mdb)};
setconn=server.createobject(ADODB.CONNECTION)
conn.openconnstr
sql=select*fromdistrictorderbylocationidasc
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
%>
分享:asp生成HTM静态列表分页(含代码,已测试成功)!--#include file=conn.asp-- htmlheadTITLE分页测试/TITLELINK href=inc/style.css type=text/css rel=stylesheet/head %strHead=strHeadhtml strHead=strHeadhead strHead=strHeadTITLE分页测试/TITLE strHead=strHeadLINK href=inc/style.cs
共3页上一页123下一页