Learning PHP and MySQL
Example 14-6 Session using the proper $_SESSION super global
<?php session_start();
$username=$_SESSION['username'];
if (isset($username)) {
echo "Hello $username";
} else {
echo "Please login.";
}
?>
Posted by on 09/25 at 02:42 PM
Next entry: Example 14-8 Checking for session hijacking
Previous entry: Example 14-7 Detecting simple variable poisoning