great minds and all that ....
this is some code  i use but i have a login page that takes the username and
passowrd and passes that to another page that does the verification.

so:
page 1 takes the username and password.
page 2 registers session vars and sets logged in to true if accepted.

every page from then on has this include file

<?php
session_start();
if ($loggedin != true)
{
 echo'<head><meta HTTP-EQUIV="Refresh" CONTENT="0;URL=login.php"></head>';
 session_destroy();
 exit;
}

i use the meta http=equiv.... to direct them to the index page of the site
if they are verified.

Steve

"Dosenbrei" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
>
> Hi
>
> Sorry for my bad english ;-)
>
> I'm writing an application using php and sessions.
> In the first include file i'm writing something like this
>
> session_start();
> session_register(loggedin);
>
> The i have another include file with the functions.
> When i'm submitting the username and passwort to the function
> which checks them i'd like to set loggedin to 1 how does this work?
>
> function CheckLogin($username,$password)
> {
> if($username=='test' && $password=='user')
> {
> $loggedin=1;
> header("location:secretpage.php");
> }
> else
> {
> $loggedin =0;
> header("location:login.php")
> }
>
> Can i user include with sessions or doe i have to use requiere?
> I also tried to set the $loggedin to 1 this way:
>
> $HTTP_SESSION_VARS[loggedin]=1;
>
> This doesn't work too.
>
> Please help me
>
>
> THX



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to