推薦:Asp三級聯動下拉菜單數據庫版(含源程序)% OptionExplicit ’數據庫: ’location ’表1loaction所在的市表 ’字段 ’loactionid(主鍵) ’loactionname名字 ’表2district所在的縣表 ’字段 ’locationid(主鍵) ’districtid ’districtname ’表3village所在的鄉鎮表 ’字段 ’districtid(主鍵
1.如何用Asp判斷你的網站的虛擬物理路徑
答 使用Mappath方法
<p align="center"><font size="4" face="Arial"><b>
The Physical path to this virtual website is:
</b></font>
<font color="#FF0000" size="6" face="Arial">
<%= Server.MapPath("/")%>
</font></p>
2.我如何知道使用者所用的瀏覽器?
答 使用the Request object方法
strBrowser=Request.ServerVariables("HTTP_USER_AGENT")
If Instr(strBrowser,"MSIE") <> 0 Then
Response.redirect("ForMSIEOnly.htm")
Else
Response.redirect("ForAll.htm")
End If
3。如何計算每天的平均反復訪問人數
答 解決方法
<% startdate=DateDiff("d",Now,"01/01/1990")
if strdate<0 then startdate=startdate*-1
avgvpd=Int((usercnt)/startdate) %>
顯示結果
<% response.write(avgvpd) %>
that is it.this page have been viewed since November 10,1998 分享:關于阻止灌水留言的一個方法(隨機生成的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
新聞熱點
疑難解答