Hi,
try this code:
<?php
define('ROOT_PATH', './');
include(ROOT_PATH.'global.php');
?>
Define the root path as relativ path to the directory 4images is installed.
If the user is loggedin there is an array $user_info with the user informations. The array contains the data like this:
$user_info['user_id'] = 1;
$user_info['user_level'] = 9;
$user_info['user_name'] = "jan";
etc.
If the user is not loggedin the array contains only this two elements:
$user_info['user_id'] = -1;
$user_info['user_level'] = -1;
You can use it like this:
<?php
if ($user_info['user_id'] != GUEST) {
echo "Welcome ".$user_info['user_name']." you are now logged in.<br />";
echo "You last visited on ".date("d.m.Y H:i", $user_info['user_lastvisit']);
}
else {
echo "Welcome Guest, please register!";
}
The constant GUEST is is defined in "includes/constants.php".
Greets Jan