21,886
社区成员
发帖
与我相关
我的任务
分享
session_cache_limiter('private, must-revalidate');
<?php
session_start();
$v = $_SESSION['aaa'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document </title>
</head>
<body>
<form id="form1" name="form1" method="POST" action="b.php">
<input type="text" name="textfield" id="textfield" value='<?php echo $v;?>'/>
<input type="submit" name="button" id="button" value="Submit" />
</form>
</body>
</html>
<?php
session_start();
if($_POST){
$_SESSION['aaa'] = $_POST['textfield'];
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document </title>
<script type="text/javascript">
window.onload = function() {
alert("go back <?=$_SESSION['aaa']?>");
window.history.go(-1);
}
</script>
</head>
<body>
</body>
</html>
<form action="" method="post">
<input type="text" name="test" value="<?php echo $_POST['test']; ?>" />
<input type="submit" name="submit" />
</form>