example.php
<?PHP
define('FORUM_ROOT', 'forum/');
require FORUM_ROOT.'include/common.php';
if ($forum_user['is_guest']) { // Guest user
echo 'You are not logged in. Please <a href="forum/login.php">login</a> or <a href="forum/register.php">register</a>.';
}
else {
echo forum_htmlencode($forum_user['username']).'<br>'; // Username
echo $forum_user['id'].'<br>'; // User ID
echo generate_form_token('logout'.$forum_user['id']).'<br>'; // User logout token
echo '<a href="forum/login.php?action=out&id='.$forum_user['id'].'&csrf_token='.generate_form_token('logout'.$forum_user['id']).'">Logout</a>'; // Logout link
}
echo '<br><br><a href="forum/viewtopic.php?id=1">Back</a>';
?>