首页 > Web开发 > 详细

php -- session

时间:2014-05-25 03:34:37      阅读:418      评论:0      收藏:0      [点我收藏+]

----- 012-form.html -----

bubuko.com,布布扣
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <title>一个PHP网页</title>
</head>
<body>
<center>
    <form action="012-session.php">
        用户名:<input type="text" name="username"/><br/>&nbsp;&nbsp;码:<input type="text" name="password"/><br/>
        <input type="submit" name="submit" value="登录"/>
        <input type="reset" name="reset" value="重置"/>
    </form>
</center>
</body>
</html>
bubuko.com,布布扣

----- 012-session.php -----

bubuko.com,布布扣
 1 <!DOCTYPE html>
 2 <html>
 3 <head>
 4     <meta http-equiv="content-type" content="text/html; charset=utf-8">
 5     <title>一个PHP网页</title>
 6 </head>
 7 <body>
 8 <?php
 9     echo "保存会话<br/>";
10     session_start();
11     $_SESSION[‘username‘] = $_GET[‘username‘];
12     $_SESSION[‘password‘] = $_GET[‘password‘];
13     echo "现在的会话内容是:<br>";
14     echo "用户名:", $_SESSION[‘username‘], "<br/>";
15     echo "密码:", $_SESSION[‘password‘], "<br/>";
16 ?>
17 </body>
18 </html>
bubuko.com,布布扣

bubuko.com,布布扣

bubuko.com,布布扣

php -- session,布布扣,bubuko.com

php -- session

原文:http://www.cnblogs.com/baijifeilong/p/3750402.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!