I enabled "Save username and password between visits." option. And I have to visit the forum first to make this code work:

if ($pun_user['group_id'] == PUN_ADMIN || $pun_user['group_id'] == PUN_MOD)
    echo("<a href=\"forum/login.php?action=out&id=".$pun_user['id']."\">LOG OUT</a>");

There is another problem. Although I am logged in all the time, I'm not logged in till I open the forum site.

Yeah it works, thanks for help.

No, still the same.

That's the whole code:

<html>
<head>
<?php
define('PUN_ROOT', './forum/');
define('PUN_TURN_OFF_MAINT', 1);
define('PUN_QUIET_VISIT', 1);
require PUN_ROOT.'include/common.php';
?>
<script type="text/javascript">
<!--
function process_form(the_form)
{
    var element_names = new Object()
    element_names["req_username"] = "Username"
    element_names["req_password"] = "Password"

    if (document.all || document.getElementById)
    {
        for (i = 0; i < the_form.length; ++i)
        {
            var elem = the_form.elements[i]
            if (elem.name && elem.name.substring(0, 4) == "req_")
            {
                if (elem.type && (elem.type=="text" || elem.type=="textarea" || elem.type=="password" || elem.type=="file") && elem.value=='')
                {
                    alert("\"" + element_names[elem.name] + "\" jest wymagane aby si? zalogowa?.")
                    elem.focus()
                    return false
                }
            }
        }
    }

    return true
}
// -->
</script>
</head>
<body>

<?php
if ($pun_user['is_guest'])
    {    
    echo('<form id="login" method="post" action="forum/login.php?action=in" onsubmit="return process_form(this)">
    <div class="infldset">
    <input type="hidden" name="form_sent" value="1" />
    <input type="hidden" name="redirect_url" value="../index.php" />
    <logowanie>Login:   </logowanie>
    <input type="text" name="req_username" size="10" maxlength="25" tabindex="1" />
    
    <logowanie>  Has?o:  </logowanie>
    <input type="password" name="req_password" size="10" maxlength="16" tabindex="2" />

    <input type="submit" name="login" value="Login" tabindex="3" />

    </form>');    
    }

if ($pun_user['group_id'] == PUN_ADMIN || $pun_user['group_id'] == PUN_MOD)
    echo("<a href=\"forum/login.php?action=out&id=$pun_user['id']\">LOG OUT</a>");
/*dla reszty*/
else
    {
    
    }
?>


</body>
</html>

I use this code (lines 59 an 60)

if ($pun_user['group_id']  == PUN_ADMIN||$pun_user['group_id']  == PUN_MOD)
    echo("<a href=\"forum/login.php?action=out&id=$pun_user['id']\">LOG OUT</a>");

And it doesn't work:

index.php wrote:

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in c:\usr\krasnal\www\_jgames_\index.php on line 60

Why?

I want to create a logging out link.

<a href="forum/login.php?action=out&id=2">Log out</a>

Maybe there is a way to do something like here

erissiva wrote:
<input type="hidden" name="redirect_url" value="index.php" />

Edit: I have just noticed that id is different for each user, is there other way to do that?

Thanks, it works.
DO you know how to redirect to my home page after logging out.

Like this?

if ($pun_user['1'])
Connorhd wrote:
if ($pun_user['is_guest'])
?>

And how to check if he user is a moderator and admin?

I can't find it in login.php can you post the correct form code?
And how can I check if the user is logged in and what are his rights (is he a moderator or not)?

I would like to make a log on form on my website, how to do it?