如何讓用戶再次訪問我的網(wǎng)站時不需再提交相關(guān)信息?
< %@ LANGUAGE="VBscript" % >
< %
Chunfeng=Request.Cookies("Chunfeng")
' 初始設(shè)置頁面,讀取名字為Chunfeng的Cookie值.
If Chunfeng ="" then
' 判斷是否已經(jīng)存在Cookie值.
Response.Cookies("Chunfeng")="x"
Response.Cookies("Chunfeng").Expires=#January 01, 2010#
Response.Redirect "Chunfeng.asp"
' 如果不存在,就創(chuàng)建并設(shè)置Cookie,并轉(zhuǎn)到頁面Chunfeng.asp.當下次訪問時,因為存在Cookie值,就不會再轉(zhuǎn)到Chunfeng.asp 頁面.
Else
'rest of the page
' 如果Cookie已經(jīng)存在,則訪問者將執(zhí)行頁面中剩余的代碼.
End if
% >
相關(guān)文章
asp中在JScript中使用RecordSet對象的GetRows
asp中在JScript中使用RecordSet對象的GetRows...2007-03-03