session实现不同页面间传递数据

数据在index.php和i.php之间通信
index.php

session_set_cookie_params($_POST("check"));
session_start();
if($_POST[sub]){
    if($_POST['user']!="" && $_POST("pwd")!=""){
          if($_POST['user']==="mr" && $_POST("pwd")==="miscrof"){
                  $_SESSION['user']=$_POST["user"];
                  $_SEESION['pwd']=$_POST["pwd"];
                  $_SESSION['check']=$_POST["check"]
                  echo""
          }
    }else{
            echo""
     }
}

i.php

session_start();
echo"当前时间".data('Y-m-d')."
"; echo"用户名".$_SESSION["user"]."
"; echo"密码".$_SESSION['pwd']."
"; echo"实效".$_SESSION['check']."
"; echo "退出"

logout.php
···
session_start();
session_destroy();
echo"

你可能感兴趣的:(session实现不同页面间传递数据)