いくつかのASPのヒントと実用的なソリューション
乱数:
<%ランダム化%>
<%=(int(rnd()*n)+1)%>
データのクエリが赤で表示されるときに取得されたレコードキーワード:
<%=置換(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「プラグマ」、「ノーキャッシュ」
response.addheader「キャッシュコントロール」、「プライベート」
Response.cachecontrol = "no-cache"
%>
ドロップダウンメニューの年と月を表示します
<selectname = "select">
<%
dimm_year
dimm_month
dimm_monthj
dimm_themonth
dimm_ym
form_year = 2000toyear(日付)
m_month = 12
ifm_year = year(date)then
m_month =月(日付)
endif
form_monthj = 1tom_month
ifm_monthj <10then
m_themonth = "0"&m_monthj
それ以外
m_themonth = m_monthj
endif
m_ym = m_year& " - "&m_themonth%>
<optionValue = "<%= m_ym%>"> <%= m_ym%> </option>
<%
次
次の%>
</select>
データベース内の重複レコードを取得および削除します
conn.execute( "deletefromTablewhereIdnotin(selectdistinctfromtable)")