当前位置: 电脑软硬件应用网 > 设计学院 > 网络编程 > PHP教程 > 正文 |
|
|||
PHP4的session功能 | |||
2005-12-30 19:26:02 文/45IT收集 出处:电脑软硬件应用网 | |||
* test.php * ------------------------------------------------------------------------ * PHP4 Customer Session Handler Test Script * Version 1.00 * by Ying Zhang (ying@zippydesign.com) * Last Modified: May 21 2000 */ if (! isset($handler)) { $handler = "dbm"; } if (! isset($action)) { $action = "increment"; } if ($handler == "dbm") { include("session_dbm.php"); include("session_mysql.php"); echo "<li>Unrecognized handler ($handler)"; die; } session_start(); session_register("count"); switch ($action) { case "increment" : $count = isset($count) ? $count + 1 : 0; break; session_destroy(); break; $maxlife = get_cfg_var("session.gc_maxlifetime"); sess_gc($maxlife); break; echo "<li>Unknown action ($action)"; break; } ?> <ul> <li>Handler: <b><?=$handler?></b> <li>Action: <b><?=$action?></b> <li>Count: <b><?=$count?></b> </ul> <form> <table> <tr> <td>Handler:</td> <td> <select name="handler"> <option value="dbm">DBM</option> <option value="mysql">MySQL</option> </select> </td> </tr> <tr> <td>Action:</td> <td> <select name="action"> <option value="increment">Increment</option> <option value="destroy">Session Destroy</option> <option value="gc">Force Garbage Collection</option> </select> </td> </tr> <tr> <td></td> <td><br><input type="submit"></td> </tr> </table> </form> |
|||
最新热点 | 最新推荐 | 相关文章 | ||
javascript实用技巧点滴(三) javascript实用技巧点滴(2) javascript实用技巧点滴(1) javascript教程 - 第一课 1.1 用js制作完善的日,月组合下拉框 利用JSP编程建立动态Web站点 用PHP制作留言板 PHP生成动态WAP页面 PHP实现文件下载 用PHP制作动态计数器 |
关于45IT | About 45IT | 联系方式 | 版权声明 | 网站导航 | |
Copyright © 2003-2011 45IT. All Rights Reserved 浙ICP备09049068号 |