I got this script from JavaScript Kit.com. The script refers to entering a userid and password to access one page. I have multiple acquaintances with each getting their own userid and password (it doesn't matter that it isn't encrypted). I am making one page that has the script on it. I would like to modify the code to receive various userid/password combinations to access respective pages.
The original code:
<script language="javascript">
<!--//
/*This Script allows people to enter by using a form that asks for a
UserID and Password*/
function pasuser(form) {
if (form.id.value=="JavaScript") {
if (form.pass.value=="Kit") {
location="page2.html"
}
I wonder if all I need to do is add a couple lines:
<script language="javascript">
<!--//
/*This Script allows people to enter by using a form that asks for a
UserID and Password*/
function pasuser(form) {
if (form.id.value=="JavaScript") {
if (form.pass.value=="Kit") {
location="page2.html"
} if(form.id.value=="example1") {
if (form.pass.value=="pass1") {
location="page3.html"
} if(form.id.value=="example2") {
if (form.pass.value=="pass2") {
location="page4.html"
}
Am I going in the right direction?