zoukankan
html css js c++ java
一个单词查询程序
<
html
>
<
hea
>
<
title
>
Words list
</
title
>
<
STYLE
TYPE
="text/css"
>
<!--
/**/
/*
$WEFT -- Created by: Alex (hezhengyu@bit.edu.cn) on 2004-6-14 --
*/
@font-face
{
}
{
font-family
:
HMPhone BDC
;
font-style
:
normal
;
font-weight
:
normal
;
src
:
url(HMPHONE0.eot)
;
}
-->
body
{
}
{
font-family
:
"Tahoma"
;
}
</
STYLE
>
</
head
>
<
body
>
<
form
action
="find.asp"
id
=form1
name
=form1>
<input name
="name"
maxlength
="15"
size
=15>
<input type
="submit"
value
="Find it"
name
="find"
>
</
form
>
<%
sql
=
"
"
name
=
request(
"
name
"
)
sql
=
"
select * from words where word like '%
"
&
name
&
"
%'"
set
rs
=
server.
createobject
(
"
adodb.recordset
"
)
conn
=
"
DBQ=
"
&
server.mappath(
"
word.mdb
"
)
&
"
;Driver={Microsoft Access Driver (*.mdb)};DriverId=25;FIL=MS Access;"
rs.open sql,conn,
1
,
1
maxperpage
=
30
rs.pagesize
=
maxperpage
if
trim
(request(
"
page
"
))
<>
""
and
isnumeric
(request(
"
page
"
))
then
currentpage
=
clng
(request(
"
page
"
))
if
currentpage
<
1
then
currentpage
=
1
elseif
currentpage
>
rs.pagecount
then
currentpage
=
rs.pagecount
end
if
else
currentpage
=
1
end
if
if
rs.eof
then
response.write
"
<p align='center'>没有这个单词</p>"
else
totalput
=
rs.recordcount
'
记录
if
currentpage
=
1
then
showpages
showcontent
else
if
(currentpage
-
1
)
*
maxperpage
<
totalput
then
rs.move(currentpage
-
1
)
*
maxperpage
dim
bookmark
bookmark
=
rs.bookmark
'
移动至开始显示的记录位置
showpages
showcontent
else
currentpage
=
1
showcontent
end
if
end
if
rs.close
end
if
set
rs
=
nothing
set
conn
=
nothing
sub
showcontent
dim
i
i
=
0
do
while
not
(rs.eof
or
err)
result
=
replace
(rs(
"
word
"
),name,
"
<font color=black>
"
&
name
&
"
</font>
"
)
response.write rs(
"
id
"
)
&
"
<font color=red><b>
"
&
result
&
"
</b></font>
"
&
"
[<font face=""HMPhone BDC"">
"
&
rs(
"
phonetic
"
)
&
"
</font>] <font color=blue face=""隶书""><b>
"
&
rs(
"
remark
"
)
&
"
</b></font><br>"
i
=
i
+
1
if
i
>=
maxperpage
then
exit
do
rs.movenext
loop
end sub
sub
showpages()
dim
n,k
if
(totalput
mod
maxperpage)
=
0
then
n
=
totalput
/
maxperpage
else
n
=
int
(totalput
/
maxperpage)
+
1
end
if
%>
Total
<%
=
rs.recordcount
%>
words.
<%
k
=
currentpage
if
k
=
1
then
response.write
"
First page Previous "
else
response.write
"
<b><a href=find.asp?name=
"
&
name
&
"
&page=1>First page</a></b> "
response.write
"
<b><a href=find.asp?name=
"
&
name
&
"
&page=
"
&
k
-
1
&
"
>Previous</a></b> "
end
if
if
k
=
n
then
response.write
"
Next Last page<br>"
else
response.write
"
<b><a href=find.asp?name=
"
&
name
&
"
&page=
"
&
k
+
1
&
"
>Next</a></b> "
response.write
"
<b><a href=find.asp?name=
"
&
name
&
"
&page=
"
&
n
&
"
>Last page</a></b><br>"
end
if
end sub
%>
</
body
>
</
html
>
演示地址
http://www.hzsghj.gov.cn/g7/data/find.asp
查看全文
相关阅读:
多网卡绑定
deepin 20.2.3 数字时钟屏保
(原创)odoo15(master)下,列表导出权限控制
在CentOS7上扩容centos-root根目录
Linux扩容-新增磁盘分区挂载-fdisk
Docker
隐私政策(URL)
快排代码
反射将对象所有属性(含集合中所有属性)中字符串类型做trim()
Prometheus 查询语句
原文地址:https://www.cnblogs.com/Glory/p/23216.html
最新文章
【2021夏纪中游记】2021.7.19模拟赛
【Luogu P4284】[SHOI2014]概率充电器
【2021夏纪中游记】2021.7.17模拟赛
【Luogu P3980】[NOI2008] 志愿者招募
【2021夏纪中游记】2021.7.16模拟赛
【2021夏纪中游记】2021.7.15模拟赛
【YBTOJ】【国家集训队】彩色圆环
【Luogu P2704】[NOI2001] 炮兵阵地
【2021夏纪中游记】2021.7.14模拟赛
【2021夏纪中游记】2021.7.13模拟赛
热门文章
【Luogu P2018】消息传递
【YBTOJ】最长距离
【2021夏纪中游记】2021.7.12模拟赛
Alienware M15 R2 升级1T SSD固态Nvme硬盘
红队行话大全
Vue项目更换电脑后无法运行问题
Linux发行版 下载地址
Java简介
Ubuntu 配置静态/动态IP地址
nmcli 命令 Centos/red hat 不能补全
Copyright © 2011-2022 走看看