用PHP人工使網頁過期
上一篇 /
下一篇 2007-12-31 01:06:43
/ 個人分類:php
- 文件版本: V1.0
- 開發商: 網絡來源
- 文件來源: 網絡
- 界面語言: 繁中
- 授權方式: 免費
- 運行平台: Win9X/Win2000/WinXP
用PHP人工使網頁過期 detrox [翻譯]
8~i1t@:D0PB0關鍵字 網頁過期,註冊網頁編寫頂客社區D,_-i$S0n e'c
出處 http://www.phpbuilder.net/columns/clark20030702.php3頂客社區
}Z:c/w$G'?T`9j
S ^$jBH$Y0 Manually Expiring Web Pages頂客社區&[]r&c&|w5sVnt
人工使網頁過期頂客社區){n.coz(~uz
作者: Joe Clark頂客社區8t;mwY0f{_Q)M
翻譯: detrox
Ns-G4[A8uO-QT0頂客社區t)cWaH)u-A)C(u
After going through a series of pages during a registration process, you don't want the user to be able to go back after the final submit. What can you do to manually "expire" those pages, and perhaps display a custom message?頂客社區0c4[pk)U kgK
在填寫完成某註冊過程中的一系列網頁後,你不想用戶能夠在最終提交後回到以前的頁面。你應該怎樣做才能人工地使這些網頁過期,並且如果有可能則給出一條已定制好的消息呢。
3|O PK:`0In this scenario, I didn't want my session to expire as I needed it to continue. Instead, I used an extra session variable to track whether my session was alive or not. There are three main components: (1) the entry script, (2) the Cache-control directive, (3) the conditional check, and (4) manually expiring a portion of the session.
|0ISF
} Fm+U-rQ"P$S0在這一關裏,我不想讓我的session過期,因為我需要它能夠繼續運轉。我使用一個額外的session變數來跟蹤我的session是否為活動的。有三個主要的組件: (1)入口腳本(2)緩存控制指示符(3)條件檢測和(4)人工使一部分session過期。
!h"u&L&U3M^2u-n0THE ENTRY SCRIPT
ftFB7E4G0入口腳本
-_S6l:w8[%Z&}0I use an entry script. to start my session. This accomplishes two things: (1) destroys any session already in progress, and (2) starts a new session.
3A~;u'X4u&f&iX5F0我使用一個入口腳本來開始我的session.它用來完成兩件事: (1)銷毀任何已經存在於過程中的session,和(2)開始一個新的session.
'K/mk8?#r x{0entry.php:頂客社區^"K(k
m(K*Sh
<?頂客社區{
Qf.P1Z_1tD+L
php session_start(); session_unset(); session_destroy(); session_start(); session_register('alive'); $_SESSION["alive"] = "1"; Header("Location:/php/createaccount.php");?>