首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > PHP >

Lost session varible between pages,该怎么解决

2012-02-13 
Lost session varible between pagesmovie1.php?php session_start()$_session[username]Jhon$_se

Lost session varible between pages
movie1.php
<?php session_start();
$_session['username']="Jhon";
$_session['authuser']=1;
?>
<html>
<head>
<title>Find my favorite movie!</title>
</head>
<body>
<?php
$myfavmovie=urlencode("transformers");
echo "<a href='moviesite.php?favmovie=$myfavmovie'>";
echo "Click here to see information about my favorite movie!</a>";
echo "<br>".$_session['username']; //ok, display Jhon



?>
</body>
</html>

moviesite.php
<?php session_start();
/*
if ($_session['authuser'] != 1){
echo $_session['authuser'];
echo "Sorry, but you don't have pemission to view the page, you loser!";
exit();
}
*/
?>
<html>
<head>
<title>My movie site - <?php echo $_request['favmovie']; ?></title>
</head>
<body>
Welcome to our site, 
<?php echo $_session['username'] ?>! //doesn't work, display nothing,why?
<br>My favorite movie is 
<?php echo $_request['favmovie'] ?>! //doesn't work, display nothing,why?
<br>
<?php $movierate=5; ?>
My movie rating for this movie is: 
<?php echo $movierate; ?>
</body>
</html>

//register_globles = OFF

[解决办法]
$_SESSION大写

热点排行