Sergiu Costas
Sergiu Costas

Reputation: 560

pop-up password input, then submit the popup

I have a web-page with a list of usernames (this is for PHP based application)... I want to achieve that by clicking over some username to optain a popup window which will open with a password input field and submit button. After Password would be typed, need to press Submit... The result should be that Popup windows will disappear and main page will login by username and password (from pop-up).

Hope I could describe clear my problem. In case of unclear things, please do not hesitate to ask me. I will appreciate any kind of support! Thank you in advance for your support!

Upvotes: 0

Views: 2029

Answers (2)

Joseph Adams
Joseph Adams

Reputation: 982

Well, there is a more complicated way and a simpler way with some trade-ins.

First the easy solution:

  • User puts in password and presses submit
  • If the password is correct, the site sets a cookie that contains the userid of the submitted popup
  • On the main page then you would have to refresh and your server would see the cookie and you could send the secure content over

The trade-in is that you'd have to refresh the original page.

Now to more complicated way:

  • You have a permanent websocket connection (IE doesn't support this I think) between the server and the main client page.
  • When the user submits the form the server sends some new data (the page that would have been loaded in the reload of the prev. example) via the websocket

I would go for the easier version because it has better support and is easier to implement.

Upvotes: 3

ethrbunny
ethrbunny

Reputation: 10469

You could do this a number of ways. The first (and prob easiest) that comes to mind would be a DIV on the page that starts out hidden. When you click on a username you move the div to the appropriate location, display it and collect the input. The DIV has the 'login' button and redirects to all the relevant FORM bits.

Upvotes: 3

Related Questions