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!

redirecting to a site based on a password

Status
Not open for further replies.

djdeuph

MIS
Feb 13, 2002
14
US
Hi all,

I was wondering if it is possible to use JavaScript for the following scenario:

When a user clicks on a link, I want it to prompt for a password (there is actually only one valid password, so I shouldn't need db connectivity). If the user enters the appropriate password he is sent to one page. If he does not enter the appropriate password, he is sent to a different page.

I don't think I need ASP to do this and hope you can steer me in the right direction.

Thanks!

Derek
 
it won't be secure since the password will be embedded in your page:

function checkPwd(sPwd) {
if (sPwd == "theCorrectPassword") {
location.href = "somePage.html";
}
else location.href = "errorPage.html";
}



=========================================================
try { succeed(); } catch(E) { tryAgain(); }
-jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top