春节义务帮人写了一个《求签在线查询》(ASP)
點擊:http://webds.sz800.cn/wg2009.asp看效果
?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=gb2312">
<title>《王公靈簽在線查詢》(Ver 2009.02.07)</title>
<style type="text/css">
body{margin:0px;background:brown;font-size:12px;}
#welcome{position:absolute;width:660px;height:440px;background:url(wgimage/welcome.jpg);
???????? top:50%;left:50%;margin-top:-220px;margin-left:-330px;}
#inputdiv{margin-left:300px;margin-top:100px;color:gray;font-size:12px}
#inputdiv hr{width:200px;text-align:left;}
#inputdiv input{border:0px;border-bottom:1px solid gray;font-size:5em;
????????? color:red;width:64px;margin-bottom:-20px;}
#inputdiv span{font-size:3em;}
#inputdiv a {color:red;}
#inputdiv input.button { border:1px solid gray;font-size:12px;
???????????????????????? border-right:1px solid black;border-bottom:1px solid black;
???????????????????????? padding:2px;}
#big {position:absolute;padding-left:54px;top:14px;}
#left {background:url(wgimage/l.gif); repeat:none;width:13px;height:548px;float:left;}
#mid {background:url(wgimage/m.gif);background-repeat:repeat-x;
????? width:740px;height:548px;
????? white-space:nowrap; display:block;
????? color:black;font-family:楷體;
????? font-size:17px;
????? padding-top:44px;
????? float:left;
????? }
#mid span{color:red;font-weight:bold;}
#mid span.t1{font-size:30px;color:maroon;font-weight:bold;}
#right{background:url(wgimage/r.gif);width:96px;height:548px;}
.ret{border:1px solid white;font-size:12px;
???????????????????????? border-right:1px solid black;border-bottom:1px solid black;
???????????????????????? padding:2px;background:orange;color:brown;}
p{
writing-mode: tb-rl; padding:0px;margin:0px;
}
</style>
</head>
<%
'自定義函數部分
dim oConn,oRS,islogin,totalcount,todatcount
dim thisYear,allYear,allAbout
zdm=split("簽號|卦類|簽詩|詩曰|家宅|歲君|求財|移居|月令|謀事|六甲|婚姻|合夥|山墳|官訟|占病|失物|行人|海水|田蠶|功名|出外|遇風|六畜|子息","|")
islogin = False
Sub DBOpen(dbname)
?Set oConn = Server.CreateObject("ADODB.Connection")
?oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source= '" & Server.MapPath(".") & dbname & "'"
?Set oRs = Server.CreateObject( "ADODB.Recordset" )
End Sub
Sub DBClose()
?On Error Resume Next
?oRs.Close
?Set oRs = Nothing
?oConn.Close
?Set oConn = Nothing
End Sub
function getzw(n)
?zw=split("一|二|三|四|五|六|七|八|九|拾","|")
?if n<=10 then
? getzw = zw(n-1)
?end if??
?
?if n>10 and n<20 then
?? a = int(n/10)
?? b = n - a*10
?? getzw = "十"+zw(b-1)
?end if
?
?if n>=20 then
?? a = int(n/10)
?? b = n - a*10
?? if b<>0 then
?? getzw =zw(a-1)+"十"+zw(b-1)
?? else
?? getzw =zw(a-1)+"十"
?? end if
?end if
?
end function
Dbopen("/TEST.mdb")
oRS.open "SELECT * FROM ncount",oConn,1,3
if Session("nowvisit")<>"Y" then
?? Session("nowvisit")="Y"
?? oRS("統計")=oRS("統計")+1
?? oRS("今日統計")=oRS("今日統計")+1
?? if date > oRS("日期") then
?????? oRS("日期") = date
?????? oRS("今日統計")=0
?? end if
?? oRS.update
end if
?? totalcount=oRS("統計")
?? todaycount=oRS("今日統計")
dbclose
xs=request.form("xs")
%>
<body>
<% if request.form("xs")<>"顯示" then %>
<div id="welcome">
? <div id="inputdiv">
? 鳴謝:對以下幫助錄入的網友:<br>
??????? 成誠、花友友、WESLEE、<br>
??????? 贊贊就是我、梅川內酷、<br>
??????? haitan138等表示衷心感謝! <br>
? <br>
? <hr>
? 請輸入你要查詢的簽號(1-51):<br>
? <form name="sc" METHOD="POST" action="wg2009.asp">
? <span>第</span>
? <input type="text" value="34" name="qh" maxlength="2"
?? οnfοcus="this.select()"
?? οnkeyup='if(this.value!="")
??????????? {re=//d/g;if(!re.test(this.value)){alert("只能輸入1-51中的數字!");this.value="";}}
??????????? if(parseInt(this.value)>51||parseInt(this.value)<1)
?? {alert("只能輸入1-51中的數字!");this.value="";}'>
? <span>簽</span><br><br>
? <input type="hidden" value="顯示" name="xs">
? <input type="submit" value="點擊查詢" class="button">
? <br><br><br><br><br>
? 統計:<font color=red><%=totalcount%></font> 今日:<font color=red><%=todaycount%></font>
? (<%=date%>)
? </form>
? </div>
?<% end if
??? if request.form("xs")="顯示" then
???? if request.form("qh")="" then %>
?? <script language="javascript">alert("請輸入1-51中的數字!");history.go(-1);</script>
? <% end if
? %>
</div>
?? <div id="big">
?? <div id="left"></div>
?? <div id="mid">
<p>
?? <%
?? if request.form("qh")<>"" then
????? Dbopen("/TEST.mdb")
????? oRS.open "SELECT * FROM content where 簽號='"&request.form("qh")&"'",oConn,1,3
???? if not oRS.eof then
?? %><span class="t1">第<%=getzw(oRS("簽號"))%>簽
??? <% if oRS("簽詩")<>"第五十一簽" then %>
??? <%=oRS("簽詩")%>
??? <% end if %>
??? </span>
???  <button class="ret" οnclick="history.go(-1);">繼續查詢</button><br><br><br>
??? <span>卦類 </span> <%=oRS("卦類")%><br>
??? <span>詩曰 </span>
???? <% if len(ors("詩曰"))>18 then %>
??? <%=left(ors("詩曰"),12)%><br>
???
??? <%=mid(ors("詩曰"),13,len(ors("詩曰"))-12)%><br>
??? <%else%>
??? <%=ors("詩曰")%><br>
??? <%end if%>
??? <br>
??? <% for i=4 to Ubound(zdm) %>
??? <span><%=zdm(i)%> </span>
??? <% if len(oRS(zdm(i)))>17 then %>
??? <%=left(oRS(zdm(i)),18)%><br>
???
??? <%=mid(oRS(zdm(i)),19,len(oRS(zdm(i)))-18)%><br>
??? <%else%>
??? <%=oRS(zdm(i))%><br>
??? <%end if%>
??? <% next %>
?? </div>
?? <div id="right"> </div>
?</p>
?</div>
<%??? dbclose()
???? end if
??? end if
?? end if %>
?? </body>
</html>
總結
以上是生活随笔為你收集整理的春节义务帮人写了一个《求签在线查询》(ASP)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: spring注解开发配置spring父子
- 下一篇: java5的新特性fore和可变参数