文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>用php人工使网页过期

用php人工使网页过期

时间:2008-05-29  来源:剑心通明


Manually Expiring Web Pages
  人工使网页过期
php程序员之家
  作者: Joe Clark
php程序员之家
  翻译: detrox
php程序员站
  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?
www.phperz.com
  在填写完成某注册过程中的一系列网页后,你不想用户能够在最终提交后回到以前的页面。你应该怎样做才能人工地使这些网页过期,并且如果有可能则给出一条已定制好的消息呢。 phperz.com
  In 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. phperz~com
  在这一关里,我不想让我的session过期,因为我需要它能够继续运转。我使用一个额外的session变量来跟踪我的session是否为活动的。有三个主要的组件: (1) 入口脚本 (2) 缓存控制指示符 (3)条件检测 和 (4) 人工使一部分session过期。 www.phperz.com
  THE ENTRY SCRIPT phperz~com
  入口脚本
php程序员站
  I 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.
www.phperz.com
  我使用一个入口脚本来开始我的session. 它用来完成两件事: (1) 销毁任何已经存在于过程中的session,和(2) 开始一个新的session.
php程序员之家
  entry.php:
www.phperz.com
  phperz.com
  php  session_start();  session_unset();  session_destroy();  session_start();  session_register('alive');  $_SESSION["alive"] = "1";  Header("Location:/php/createaccount.php");?> 
php程序员站
  In the above script, we start the session, get rid of any registered session variables with session_unset(), and destroy that session with session_destroy(). Then, we start a new session and register a session variable. This particular variable will track whether this portion of the session is alive or not. We set the variable to some value, then we redirect to our first page in the registration series.
www.phperz.com


相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载