page 1 : login.php

input user name -> Post veriable
input password-> post variable

page 2 : verify.php
session_start()

// supposing name is entered
if (!$_POST['password'] == "")
{
        // verification against database
        if (successfully authenticated)
        {
                $_SESSION['user']       = $_POST['user'];
                header("location: authPage.php");
        }
}
header("location: login.php"); // returns back to login page

-----Oorspronkelijk bericht-----
Van: Angelo Zanetti [mailto:[EMAIL PROTECTED]
Verzonden: Wednesday, June 11, 2003 3:09 PM
Aan: [EMAIL PROTECTED]
Onderwerp: [PHP] Sessions and login


Hi guys kinda new to php.

Ok I have a php page that a user has to enter a pw to gain access to another
page (lets call it authPage).However before I i can grant access to authPage
I want to verify 1. that a pw was entered and 2. that it is correct. So I
thought it would be better NOT to do the auth in authPage but rather have
another page that does the authorization. Lets call that page verifyPage. On
here if the password is entered and is correct according to the DB then I
want to create and register a session. This is how ive done the session
section:

session_register('user');
   $_SESSION['user'] = "ebusUser";


Then I want the session to call authPage (because the pw is correct)
together with the session variable. The way I am doing this (doesnt seem to
be working) is to call authPage with as a header call eg:

header("Location: authPage.php");

The problem I think I am having is that the session variable isnt being
passed to the authPAge. How else can I call the authPage from verifyPage so
that the session variable gets passed. BTW I have register_globals = on;

Any help would be greatly appreciated.

Angelo


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to