實際使用的「$ _SESSION [‘AUTHUSER’] = 1」的宗旨,我無法理解爲什麼我們用「$ _SESSION [‘AUTHUSER’] = 1;」在php代碼中,我的代碼如下什麼是PHP,爲什麼我們在本節用1
<?php
session_start();
$_SESSION['username'] = $_POST['user'];
$_SESSION['userpass'] = $_POST['pass'];
$_SESSION['authuser'] = 1;
//Check username and password information
if(($_SESSION['username'] == 'joe') and
($_SESSION['userpass'] == '123')) {
$_SESSION['authuser'] = 1;
}
else
{
echo 'Sorry, but you don\'t have permission to view this page!';
exit();
}
?>