推荐: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
共2页上一页12下一页