Forum Moderators: coopster
However, I have realized this is overkill for my purposes. Basically, all I want is a my page to recognize if a user is signed in, present a kind word to them, and if not, tell them they are not signed in.
I use sessions to accomplish this. Here is some sample code of what I would like to accomplish:
If they have logged in, this shows up:
<?php
echo "<html>
<body>
Welcome Back $firstName $lastName";
?>
If not, then the message "You are not logged in!" will appear in the smae place instead, with a link to the login page.
I am sure this is relatively easy, but alas, I cannot seem to figure this out (as usual!)
Thanks for your advice!
And do something in those lines:
session_start(); // to initiate sessions
if (session_is_registered("authentification"))
{
//carry on!
}
else {
header("Location:index.php?error=intru"); // redirection to a login GUI page
} //error_reporting(E_ALL); // use to check your error
//Error needs to be turned on in your PHP.ini for test purpose
//and off for production