Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logon...showModalDialog...check password...redirect....

Status
Not open for further replies.

booboo0912

Programmer
Jul 31, 2002
75
0
0
US
hello! i have a conglomerate of things going on, and i hope this is the right forum! here's the situation...

a user clicks on a link to access the logon screen. the logon screen is a showModalDialog window, with two text boxes and a submit button (inside form tag, action="admin.asp"). on the admin.asp page, i would like to check the password, and if the password is wrong, somehow send them back to the original logon screen. is the password is correct, close the modal windown and send the user to the admin.asp page.

the way i usually check the password is by doing the following:

<%
var pwd = Request.Form(&quot;password&quot;);

if(pwd != 'the password') {
Response.Redirect('logon.asp');
}

%>

i know it's not the most ideal/secure way of password protection, but this is small beans stuff. so my problem is trying to get back to the logon.asp page, in the modal state.

any ideas??? i always learn a lot from this forum, so if there's any other suggestions, i thank you in advance!! :)

 
Why not put a form with hidden variables in the page that opens up your modal dialog screen, and then when the button is clicked to submit the information, it's just a plain button that puts the info in the opener form and submits THAT page, then closes itself? An incorrect login or password could redirect to the original page, with the link to open the modal dialog for logging in again.

There's no way you can have any security if you do your checking with client side JS, because that means the client computer has to have the secure information on it. The only workable method is to use a list of hash values of logins and passwords, and then use the same formula in client side JS to create the numbers to check against the list, and proceed from there.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top