推薦:關於阻止灌水留言的一個方法(隨機生成的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下一頁