Some Asp tips and practical solutions
Random number:
<%randomize%>
<%=(int(rnd()*n)+1)%>
The record keywords obtained when querying data are displayed in red:
<%=replace(RS("field X"),searchname,"<fontcolor=#FF0000>"&searchname&"</font>")%>
Through Asp means, check whether the client has used the agent.
<%ifRequest.ServerVariables("HTTP_X_FORWARDED_FOR")<>""then
response.write"<fontcolor=#FF0000>You have passed the proxy server,"&_
"The real IP is"&Request.ServerVariables("HTTP_X_FORWARDED_FOR")
endif
%>
Determine the source of the previous page
request.servervariables("HTTP_REFERER")
javascript:document.referrer
Clear cache, reload page
<%response.expires=0
response.expiresabsolute=now()-1
response.addHeader"pragma","no-cache"
response.addHeader"cache-control","private"
Response.cachecontrol="no-cache"
%>
Show year and month in the drop-down menu
<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>
Retrieve and delete duplicate records in the database
conn.execute("deletefromtablewhereidnotin(selectdistinctfromtable)")