如何讓用戶再次訪問(wèn)我的網(wǎng)站時(shí)不需再提交相關(guān)信息?
< %@ LANGUAGE="VBscript" % >
< %
Chunfeng=Request.Cookies("Chunfeng")
' 初始設(shè)置頁(yè)面,讀取名字為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)到頁(yè)面Chunfeng.asp.當(dāng)下次訪問(wèn)時(shí),因?yàn)榇嬖?/SPAN>Cookie值,就不會(huì)再轉(zhuǎn)到Chunfeng.asp 頁(yè)面.
Else
'rest of the page
' 如果Cookie已經(jīng)存在,則訪問(wèn)者將執(zhí)行頁(yè)面中剩余的代碼.
End if
% >
相關(guān)文章
如何實(shí)現(xiàn)點(diǎn)擊數(shù)的計(jì)算?
如何實(shí)現(xiàn)點(diǎn)擊數(shù)的計(jì)算?...2006-11-11asp中在JScript中使用RecordSet對(duì)象的GetRows
asp中在JScript中使用RecordSet對(duì)象的GetRows...2007-03-03如何實(shí)現(xiàn)人民幣的大寫轉(zhuǎn)換?
如何實(shí)現(xiàn)人民幣的大寫轉(zhuǎn)換?...2006-11-11