I'm running Apache/2.0.54(Debian Linux) with PHP/5.0.4. I know this is not the php5 forum and, as I'm just beginning with AMP, I'm hoping that this book will suffice until I can acquire the 5 series book. That said, I'm stuck on Ch2 pgs 52-54.
Clicking the link in movie1.php brings up the "Sorry...." page, so I know that the username and authuser variables are not being passed. The session.save_path is set to default at /tmp, and viewing that directory does indeed reveal a newly created session document. The problem, I think, lies in that there is no information in the document, therefore, no variables are being being passed to the moviesite.php page. What settings need to changed/made/adjusted in order to fix this problem? Thank you for any assistance. The code is listed:
movie1.php
Code:
<?php
session_start();
$_session['username'] = 'Joe12345';
$_session['authuser'] = 1;
?>
<html>
<head>
<title>Find My Favorite Movie</title>
<body>
<?php
$myfavmovie=urlencode("Life of Brian");
echo "<a href='http://localhost/exp/moviesite.php?favmovie=$myfavmovie'>";
//echo "<a href='http://localhost/exp/sessiontest.php'>";
echo "Click here to see information about my favorite movie!";
echo "</a>";
?>
</body>
</html>
moviesite.php
[code]
<?php
session_start();
//check to see if user has logged in with a valid password
if ($_session['authuser'] != 1) {
echo "Sorry, but you don't have permission to view this page!";
exit();
}
?>
<html>
<head>
<title>My Movie Site = <?php echo $_request['favmovie'] ?></title>
</head>
<body>
<?php
echo "Welcome to our site, ";
echo $_session['username'];
echo "! <br>";
echo "My favorite movie is ";
echo $_request['favmovie'];
echo "<br>";
$movierate=5;
echo "My movie rating for this movie is: ";
echo $movierate;
?>
</body>
</html>
[/code