我使用header传递参数,但没有工作
这是第1页:
session_start();
$_SESSION['favcolor'] = 'green';
$_SESSION['animal'] = 'cat';
$_SESSION['time'] = time();
$problem = "correct";
header('Location:trynew2.php?problem=$problem');
?>
这是我的第二页:
<?php
session_start();
echo "welcome" ;
$problem = $_GET['problem'];
echo $problem;
$test = $_SESSION['favcolor'];
echo $test;
?>
结果很受欢迎$problemgreen