How to log in ?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi All,

I have tried to achieve the following with no success:

To open the Login_Window from anywhere, be that a new instance of the
browser or from an existing webpage, and allow the user to put in username
and password.

If authenticated OK, close the Login_Window and bring up a new one, if NOT,
return to the Login_Window and try again.

So far I have achieved an endless loop of opening new instances of the

Can someone help?

How is this done normally?


Re: How to log in ?

Tom Szabo wrote:
Quoted text here. Click to load it

When the user enters the (say, correct...) username and password to your
login window, he's going to be doing a POST to the input-form you have
created.  (Note: there must indeed be a <form> tag!)  Your job, before you
generate any output at all, will be to determine if the login is correct.

If it is, you'll generate a redirect ... a "Location:" header ... as your
only output, sending the user to the main application page.

Each of your other pages must, similarly, check to see if the user is
logged-in and, if not, redirect to the login page.  

If you find yourself endlessly going back to the login-page, there are
therefore two possibilities to check: (1) the login-form isn't working; (2)
the login-form is working, the user's getting redirected to another form,
and that form's bouncing the user right back.

"print" is your friend.  Add debugging messages.  Or, check the server log.

Re: How to log in ?

Quoted text here. Click to load it
Quoted text here. Click to load it

Thanks for the above but it doesn't answer the real problem. My login
actually works fine on the same bases as you have layed out. My problem is
that I want to make the login window a certain size and appearance. This
requires a redirection in some cases, like when the user just types in the
address and navigates to the app...

 Other times, like when the user failed with the login the user has to go
back to the login page, can be done by the "history".

The simplest is when the user has clicked on a link that was ment to take
him/her to the login window.

this is what I have tried :
function Is_Login_Win(){        //this is what ment to determine if the user
is already in the login window or just came from outside!

 if (isset($_REQUEST["Target_Form"])){
  return true;
  return false;
  }else{            //Get_Post();
   $oPage = new Main_Menu();
  if (Is_Login_Win()){
    $oPage = new Login_Win();            // login window is generating the
   $oPage = new GoTo_Login_Win();    // while here we redirect

this is what the " new GoTo_Login_Win(); " returns to the browser:

oWin =' ?

and I end up having endless new login windows opening one after the other...

How can I achieve the above?



Re: How to log in ?

Quoted text here. Click to load it

Why not just check to see if oWin exists before creating it? If it exists,
give it the focus. If it doesn't, create it and give it the focus.

Re: How to log in ?

Quoted text here. Click to load it

    Perhaps <">>

  <?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com

Site Timeline