其次,写一个名为getinfo.asp的文件,其代码如下:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>返回值</title>
</head>
<body>
<%
response.expires=-1
dim a(32)
a(1)="Ava"
a(2)="Brielle李国强"
a(3)="Caroline"
a(4)="Diana"
a(5)="胡潇"
a(6)="张妈"
a(7)="胡泽君"
a(8)="Hannah"
a(9)="赵立军"
a(10)="Jane"
a(11)="薛瑞萍"
a(12)="孙立杰"
a(13)="罗义光"
a(14)="牛啊我"
a(15)="罗光义"
a(16)="Petty"
a(17)="胡八一"
a(18)="Rose"
a(19)="Shirley"
a(20)="Tiffany"
a(21)="Ursula"
a(22)="Victoria"
a(23)="马天宇"
a(24)="马泽"
a(25)="Yvette"
a(26)="Zoe"
a(27)="罗毅光"
a(28)="Adele"
a(29)="Beatty"
a(30)="Carlton"
a(31)="Elisabeth"
a(32)="Violet"
q=ucase(request.querystring("q"))
if len(q)>0 then
hint=""
for i=1 to 32
if q=ucase(mid(a(i),1,len(q))) then
if hint="" then
hint=a(i)
else
hint=hint & " , " & a(i)
end if
end if
next
end if
if hint="" then
response.write("无建议")
else
response.write(hint)
end if
%>
</body>
</html>
至于提示页面我们根据需要在数据库中展示不同的值提取出来即可作为更换,实现不同信息的提示。
|