一些Asp技巧和实用解决方法_ASP教程-查字典教程网
一些Asp技巧和实用解决方法
一些Asp技巧和实用解决方法
发布时间:2016-12-29 来源:查字典编辑
摘要:一些Asp技巧和实用解决方法随机数:查询数据时得到的记录关键字用红色显示:通过asp的手段来检查来访者是否用了代理判断上一页的来源reque...

一些Asp技巧和实用解决方法

随机数:

<%randomize%>

<%=(int(rnd()*n)+1)%>

查询数据时得到的记录关键字用红色显示:

<%=replace(RS("字段X"),searchname,"<fontcolor=#FF0000>"&searchname&"</font>")%>

通过asp的手段来检查来访者是否用了代理

<%ifRequest.ServerVariables("HTTP_X_FORWARDED_FOR")<>""then

response.write"<fontcolor=#FF0000>您通过了代理服务器,"&_

"真实的IP为"&Request.ServerVariables("HTTP_X_FORWARDED_FOR")

endif

%>

判断上一页的来源

request.servervariables("HTTP_REFERER")

javascript:document.referrer

清除缓存,重新加载页面

<%response.expires=0

response.expiresabsolute=now()-1

response.addHeader"pragma","no-cache"

response.addHeader"cache-control","private"

Response.cachecontrol="no-cache"

%>

在下拉菜单中显示年和月

<selectname="select">

<%

DimM_Year

DimM_Month

DimM_MonthJ

DimM_TheMonth

DimM_YM

ForM_Year=2000ToYear(Date)

M_Month=12

IfM_Year=Year(Date)Then

M_Month=Month(Date)

EndIf

ForM_MonthJ=1ToM_Month

IfM_MonthJ<10Then

M_TheMonth="0"&M_MonthJ

Else

M_TheMonth=M_MonthJ

EndIf

M_YM=M_Year&"-"&M_TheMonth%>

<optionvalue="<%=M_YM%>"><%=M_YM%></option>

<%

Next

Next%>

</select>

检索并删除数据库里的重复记录

conn.execute("deletefromtablewhereidnotin(selectdistinctfromtable)")

相关阅读
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
  • 大家都在看
  • 小编推荐
  • 猜你喜欢
  • 最新ASP教程学习
    热门ASP教程学习
    编程开发子分类