Glenn Holden
|
| Posted: 03/15/2002, 1:49 PM |
|
I would like to have the visitor register, and if successful, proceed
directly to a secure page without having to go through the login step. From
the registration page, I will have the UserID, password, etc.
Can I add the login.php to memory and call some functions? Or what is a
simpler way to do this?
Thanks,
Glenn
|
|
|
 |
Glenn Holden
|
| Posted: 03/15/2002, 5:24 PM |
|
I see where the login page sets the session variables in the LoginAction
function:
set_session("UserID", $db->f("RN"));
set_session("UserRights", $db->f("Security"));
So after insert I am doing this:
if (mysql_errno() == 0 and $sRegister_UserErr == "")
{
$resultA = mysql_query("select last_insert_id()");
$rowA = mysql_fetch_array($resultA);
set_session("UserID",$rowA["UserID"]);
set_session("UserRights",$rowA["Security"]);
mysql_free_result($resultA);
}
but when I [Submit] I am still redirected to the Login page instead of the
Order Form.
Any help or ideas is appreciated.
Glenn
"Glenn Holden" <glenn@nilenet.com> wrote in message
news:a6tqa5$em1$1@news.codecharge.com...
> I would like to have the visitor register, and if successful, proceed
> directly to a secure page without having to go through the login step.
From
> the registration page, I will have the UserID, password, etc.
>
> Can I add the login.php to memory and call some functions? Or what is a
> simpler way to do this?
>
> Thanks,
> Glenn
>
>
|
|
|
 |
Glenn Holden
|
| Posted: 03/16/2002, 3:51 PM |
|
I figured out my own problem...
In the code below my $resultA variable doesn't contain the fields I
reference later in the mysql_fetch_array. It should be:
if (mysql_errno() == 0 and $sRegister_UserErr == "")
{
// changed this line to fix the problem:
$resultA = mysql_query("select RN,Security from tblUser where RN =
last_insert_id()");
$rowA = mysql_fetch_array($resultA);
set_session("UserID",$rowA["RN"]);
set_session("UserRights",$rowA["Security"]);
mysql_free_result($resultA);
}
I'm still trying to understand PHP/MySQL array fetching. Does the
mysql_fetch_array($result) function query the database again? Or does it
use $result in memory when the server parses the php to fill the array?
Glenn
"Glenn Holden" <glenn@nilenet.com> wrote in message
news:a6u6tb$5f0$1@news.codecharge.com...
> I see where the login page sets the session variables in the LoginAction
> function:
>
> set_session("UserID", $db->f("RN"));
> set_session("UserRights", $db->f("Security"));
>
> So after insert I am doing this:
>
>
>
> if (mysql_errno() == 0 and $sRegister_UserErr == "")
> {
> $resultA = mysql_query("select last_insert_id()");
> $rowA = mysql_fetch_array($resultA);
>
> set_session("UserID",$rowA["UserID"]);
> set_session("UserRights",$rowA["Security"]);
>
> mysql_free_result($resultA);
> }
>
>
>
> but when I [Submit] I am still redirected to the Login page instead of the
> Order Form.
>
> Any help or ideas is appreciated.
> Glenn
>
>
>
>
> "Glenn Holden" <glenn@nilenet.com> wrote in message
>news:a6tqa5$em1$1@news.codecharge.com...
> > I would like to have the visitor register, and if successful, proceed
> > directly to a secure page without having to go through the login step.
> From
> > the registration page, I will have the UserID, password, etc.
> >
> > Can I add the login.php to memory and call some functions? Or what is a
> > simpler way to do this?
> >
> > Thanks,
> > Glenn
> >
> >
>
>
|
|
|
 |
|