码迷,mamicode.com
首页 > Web开发 > 详细

php -- session

时间:2014-05-25 03:35:09      阅读:345      评论:0      收藏:0      [点我收藏+]

标签:style   class   blog   c   code   java   

----- 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

标签:style   class   blog   c   code   java   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!