Members

Note: You can use your Sitellite.org account here and vice versa.

Username

Password

Remember Login

Forgot your password?

Not a member? Click here to register

Session Valid

Home Page | All Pages | Recently Revised | Authors | Feeds |

To check if a user is logged in, use the session_valid() function:


<?php

if (session_valid ()) {
    // logged in
} else {
    // not logged in
}

?>

Similarly, you can call this function from a SimpleTemplate file via:

{if session_valid ()}
    logged in
{end if}
{if else}
    not logged in
{end if}

And finally, you can call the same thing from an XT template via:

<xt:condition>
    <xt:if expr="php: session_valid ()">
        logged in
    </xt:if>
    <xt:else>
        not logged in
    </xt:else>
</xt:condition>

Created on April 23, 2005 1:25 AM by admin

Linked from: Authentication, Log In