[EMAIL PROTECTED] [[EMAIL PROTECTED]] wrote:
> Hi,
> 
> I am going to use sessions to authenticate and protect my pages, this is what 
> I have so far...
> 
> User logs in via form, this is checked via a SQL call, if the correct 
> username and password are entered I run the following:
> 
> session_start();
>     session_register("UserName","Password");

You have to register each "field" like this:

      session_register("UserName");   // register UserName as a session var
      $UserName = $new_value_for_username; // give UserName session var a
                                              new value.
      session_register("Password");   // register Password as a session var
      $Password = $new_value_of_password; // give Password session var a
                                             new value.

Then in the next script, after you do session_start();, you
will have access to those previously registered session
variables by just using $UserName and $Password.

HTH.

-- 
Hardy Merrill
Mission Critical Linux, Inc.
http://www.missioncriticallinux.com

>     header ("Location: Http://www.domain.com/members/index.php");
> 
> The bit where I get lost is 1) how to authenticate this on each page and 2) 
> How to close the session after the browser has closed. I have tried many 
> tutorials etc but none seem to go into great detail in those areas. Anyone 
> know of any decent tutorials or any snippets I can learn from.
> 
> Thanks
> 
> -- 
> 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]

-- 
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