RE: [phplib] page_open() and if...else From: Philippe Paravicini (philippe <email protected>)
Date: 08/01/00

You should read about the 'auth' class in phplib. It's designed to provide
user authentication.

I have no idea what your code is doing. Nevertheless, I feel safe in saying
that the statements following the 'if' and the 'else' are never both
executed at the same time. One leg may be executing at one time, and if the
page is reloading the other leg may be executing at a different time (which
could give the illusion that they are both executing) but they would not
both execute during one 'pass' through the code.

I hope this helps.

> -----Original Message-----
> From: Mikhail Avrekh [mailto:ami <email protected>]
> Sent: Monday, July 31, 2000 4:29 PM
> To: phplib <email protected>
> Subject: [phplib] page_open() and if...else
>
>
> Hello,
>
> Part of my site is supposed to be password-protected, so there is a login
> form which prompts a user for id/password and calls the following script:
>
> <?
>
> $auth = new DB_Sql;
> $auth->query("select * from table where pwd=$pwd and id=$id");
>
> if ($auth->next_record()) {
>
> page_open(array("sess"=>"My_Session"));
> $sess->register("id");
> page_close();
>
> include "nextpage.php3";
> } else {
> print "Your password is not in the database";
> exit;
> }
>
> ?>
>
> This worked fine until I inserted the page_open -- register -- page_close
> block (I now need to re-use the id in subsequent pages), but now for some
> reason immediately after page_open() is called, the script jumps to } else
> {, gives the error message and exits. Am I completely missing something
> obvious here ?
>
> Thanks !
>
> M.
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: phplib-unsubscribe <email protected>
> For additional commands, e-mail: phplib-help <email protected>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>