Topic: Logout Link

Hello,

I'm building a website around PunBB 1.2.22, using the user management system.  On the enternal index page of the site, I have intergrated a login form, but how would I go about adding a logout link?

Here is the code I have thus far:

<?php
    define('PUN_ROOT', './forums/');
    //require PUN_ROOT.'include/common.php';
    define('PUN_QUIET_VISIT', 1);
 
    if (!$pun_user['is_guest'])
    {
        echo '<br><font face="Verdana" style="font-size: 9pt" color="#FFFFFF">Hello '.pun_htmlspecialchars($pun_user['username']);
        $avatardir = "forums/img/avatars";
 
        if ($img_size = @getimagesize($avatardir.'/'.$pun_user['id'].'.gif'))
            $user_avatar = '<img src="'.$avatardir.'/'.$pun_user['id'].'.gif" alt="" border="0"/><body topmargin="0" leftmargin="0"><br />';
        else if ($img_size = @getimagesize($avatardir.'/'.$pun_user['id'].'.jpg'))
            $user_avatar = '<img src="'.$avatardir.'/'.$pun_user['id'].'.jpg" alt="" border="0"/><br />';
        else if ($img_size = @getimagesize($avatardir.'/'.$pun_user['id'].'.png'))
            $user_avatar = '<img src="'.$avatardir.'/'.$pun_user['id'].'.png" alt="" border="0" /><br />';
    }
    else
    {
        $user_avatar = '<img src="'.$avatardir.'/no-avatar.jpg" alt="" border="0" />';    
    }
 
 
    echo "$user_avatar";
 
    //if user is a admin
    if ($pun_user['g_id'] == 1)
    {
        echo "Forum Admin<br />";
        echo "Poll Admin<br />";
        echo "Webmail<br />";
        //For All Members
    }
    else if ($pun_user['g_id'] == 4)
    {
        echo "<br><br>Your Profile<br />";
        echo "Message Box<br><br />";
        
 
    }
    else
    {
        $redirect_url = '' ;
 
        if(isset($_SERVER['REQUEST_URI']))
            $redirect_url = $_SERVER['REQUEST_URI'] ;
 
        require PUN_ROOT.'lang/'.$pun_user['language'].'/login.php';
        echo '<center><font face="Verdana" style="font-size: 9pt" color="white"><br>Welcome Guest</font>
        <form style="text-align: center;" id="login" name="login" name="qpost" method="post" action="forums/login.php?action=in">
 
                    <input type="hidden" name="form_sent" value="1" />
                    <input type="hidden" name="redirect_url" value="index.php" />
                    Username<br />
                    <input type="text" name="req_username" size="16" maxlength="25" /><br /><br />
                    Password<br />
                    <input type="password" name="req_password" size="16" maxlength="16" wrap="virtual"><br /><br />
                    <input type="submit" name="login" value="Login" /><br /><br />
                    <a href="forums/register.php">Register now!</a>
 
</form></center>
        ';
     }
?>

Thank you for the help
and kind regards
DirtyDeeds