Jump to content

Login screen that calls a php script


ginerjm

Recommended Posts

Very simple subject but not the way I want to do it perhaps.

 

Basically, I have a php-generated full-screen menu on screen.  One link on it calls a js func to open up a small window on top and call a php script to handle the login process inside this popup.  Once the user is validated (by the php script in that popup), I want to continue on to a full-size window, closing the login window behind me.  I'd really like to re-use the original php menu's window, but if I have to open up a new window on top of it, so be it.  Of course, if the logon fails, I'd like to return an error message to the popup window and let the user try again.

 

So - how does one do this?  Right now, my menu opens the popup just fine and the called url functions perfectly - I just can't get the next script top run in the appropriate window.

Link to comment
Share on other sites

If I understand you correctly, you want to go direct the user to the popup for input, then close the popup and continue navigation. The popup window's DOM object should contain a parent attribute that references the original window that opened it. You could use that object to refresh the original page, navigate elsewhere, or whatever you want to do.

Link to comment
Share on other sites

Lemmin,

I think you have the idea.  Yes - the login/popup window does the verification/authentication and then decides if the user should continue on or re-try his login.  My trouble is getting the "continue on" to appear in the right window.  That's my dilemma. 

 

With IE I've not had good success addressing the parent window/script.  From some things I've researched, I should be able to pass something back from my window.open (js) but that never works for me in IE.  Do you have some code I could see that works?  Or did you have something else in mind for this process?

 

 

Link to comment
Share on other sites

For anyone following my dilemma - here's my solution (still in the works, but designed)

 

My main menu link has an onclick event on it that gets a boolean answer from the js code - this will then either call my appl's script, or stay right there on the menu (false = no submit).

 

The onclick js function will open a dialog box (a hidden div actually) containing my login form fields.  The form will receive the info from the user and on the 'log in' button another onclick will call a js function that grabs the input, makes an httprequest call to a php script that validates the user's entries and returns true or false (with a message).  This is the result that is passed all the way back to the original menu onclick.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.