PHP存入session And Cookie

session

$变量1 = $_POST['文本1'];
$变量2 = $_POST['文本2'];
  /*  存入session  */
session_start();
$_SESSION['存入的名'] = $变量1;
$_SESSION['存入的名'] = $变量2;
  /*  读取session  */
$_SESSION['session名称']

Cookie

  /*  存入cookie  */
setcookie("cookie名字","值",时间);
  /*  读取cookie  */
$_COOKIE['cookie名称'];

你可能感兴趣的:(PHP存入session And Cookie)