I have this in my website using it in my chat. I recommend it if you have a login system. and need to see if a user is or isnt logged in
PHP Code:
<?php
session_start();
include_once"config.php";
if(!isset($_SESSION['username']) || !isset($_SESSION['password'])){
echo '<h4>You are not logged in. Please do so <a href="http://jays.netne.net/loginsystem/login.php">Login</a></h4>'; }
else {
echo "<h4>You are logged in </h4>";
}
?>