Some ASP skills 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, "<font color = # ff0000>" & searchname & "</font>") %>
Use ASP to check whether proxy is used by visitors
<% If request. servervariables ("http_x_forwarded_for") <> "then
Response. Write "<font color = # ff0000> you have passed the proxy server ,"&_
"The real IP address is" & request. servervariables ("http_x_forwarded_for ")
End if
%>
Determine the source of the previous page
Request. servervariables ("http_referer ")
Javascript: Document. referrer
Clear cache and reload the 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
<Select name = "select">
<%
Dim m_year
Dim m_month
Dim m_monthj
Dim m_themonth
Dim m_ym
For m_year = 2000 to year (date)
M_month = 12
If m_year = year (date) then
M_month = month (date)
End if
For m_monthj = 1 to m_month
If m_monthj <10 then
M_themonth = "0" & m_monthj
Else
M_themonth = m_monthj
End if
M_ym = m_year & "-" & m_themonth %>
<Option value = "<% = m_ym %>"> <% = m_ym %> </option>
<%
Next
Next %>
</SELECT>
Retrieve and delete duplicate records in the database
Conn.exe cute ("delete from table where id not in (select distinct from Table )")