Asp三級聯(lián)動下拉菜單數(shù)據(jù)庫版(含源程序)_ASP教程
教程Tag:暫無Tag,歡迎添加,賺取U幣!
推薦:關(guān)于阻止灌水留言的一個方法(隨機(jī)生成的4位認(rèn)證碼)原理:在每次提交留言的時候,要輸入隨機(jī)生成的4位認(rèn)證碼. 以下代碼用在ASP 生成隨機(jī)4位數(shù): % dim key randomize timer key=Int((8999)*Rnd +1000) % 在表單里顯示: 認(rèn)證碼:%=key% input type=text name=rekey size=8 maxlength=4 input value=%=key
<%Option Explicit
’數(shù)據(jù)庫:
’location
’表1 loaction 所在的市 表
’ 字段
’ loactionid (主鍵)
’ loactionname 名字
’表2 district 所在的縣 表
’ 字段
’ locationid (主鍵)
’ districtid
’ districtname
’表3 village 所在的鄉(xiāng)鎮(zhèn) 表
’ 字段
’ districtid (主鍵)
’ villageid
’ villagename
%>
<html>
<head>
<title>List</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
dim conn
dim rs
dim sql
dim count
dim rs1
dim sql1
dim rs2
dim sql2
dim count2
dim connstr
connstr="DBQ="+server.mappath("db11.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
sql = "select * from district order by locationid asc"
set rs = conn.execute(sql)
%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%=trim(rs("districtname"))%>","<%= trim(rs("locationid"))%>","<%= trim(rs("districtid"))%>");
<%
count = count + 1
rs.movenext
loop
rs.close
set rs=nothing
%>
分享:asp生成HTM靜態(tài)列表分頁(含代碼,已測試成功)!--#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
相關(guān)ASP教程:
- asp FSO 讀寫文件本文件實(shí)現(xiàn)代碼
- asp中isNull、isEmpty和空字符串的區(qū)別
- asp獲取用戶真實(shí)IP地址的方法
- asp連接sqlserver數(shù)據(jù)庫實(shí)現(xiàn)代碼
- asp中正則表達(dá)式過濾html代碼函數(shù)
- asp中g(shù)et post提交表單區(qū)別
- 網(wǎng)頁模板:ASP內(nèi)建對象Request
- xmlhttp的open方法使用詳解
- ASP的常用的自定義函數(shù)大全
- asp中用for循環(huán)的一個小技巧
- eWebEditor v3.8 列目錄
- ASP無組件分頁實(shí)現(xiàn)思路及代碼
- 相關(guān)鏈接:
- 教程說明:
ASP教程-Asp三級聯(lián)動下拉菜單數(shù)據(jù)庫版(含源程序)
。