Hi guys, I’ve just opened a book on PHP and am a complete beginner. There is this program I’m sort of stuck on because the book doesn’t elaborate on certain bits. The program I’m asking about passes variables from one page to another using $_SESSION function. In the program the Username is passed from one page to another.
[code]
<?php session_start(); $_SESSION[‘username’] = “Joe12345”; $_SESSION[‘authuser’] = 1; ?> Find my Favorite Movie! <?php $myfavmovie = urlencode(“Life of Brian”); echo “”; echo “Click here to see information about my favorite movie!”; echo “”; ?> [/code]The page the above page is linked to contains the following php code before the html code begins:
[php]<?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, you loser!”;
exit();
}
?>[/php]
My question is, what is this ‘authuser’ thing here. What is it’s purpose? A detailed answer would really be appreciated (also please keep in mind, I’m a noob :-[, so please try to explain as simply as possible).
Thanks a lot!