/* ------------------------------------------------------------------- INSTRUCTIONS - Read Before Using Script If you are using frames, the code referred to in steps 2 - 5 must be put in the pages displayed in the frames and NOT in the parent document. Step 1 In the Usernames & Passwords section, configure the variables as indicated by the comments. Step 2: Add the following code to the section of your login page: Change "scripts/login.js" to reflect the correct path to this script file on your server. Step 3: Add this code to the login page, at the place you want the login panel to show: Step 4: Add the following code to the section of each page procteded by this script: Change "scripts/login.js" to reflect the correct path to the script file on your server. Step 5: On the page that is to have the logout button, paste this code where you want the button to be:
To use your own image instead of the grey button change the type from button to image and add src="myimage.gif" where myimage.gif is the image (including the path to it if needed, you want to use. Step 6: Upload this script and your html pages to the relevant directories on your server. */ //---------------------------------------------------------------- // Usernames, Passwords & User Pages - These require configuration. //---------------------------------------------------------------- var successpage = "protectedpage1.html"; // The page users go to after login, if they have no personal page. var loginpage = "index.html"; //Change this to the page the login panel is on. var imgSubmit = ""; //Change to the path to your login image,if you don't want the standard button, otherwise do not change. var imgReset = ""; //Change to the path to your reset image,if you don't want the standard button, otherwise do not change. var users = new Array(); users[0] = new Array("userid1","password1","protectedpage1.html"); // Change these two entries to valid logins. users[1] = new Array("userid2","password2",""); // Add addtional logins, straight after these, as users[2] = new Array("userid3","password3",""); // required, followig the same format. Increment the // numbers in the square brackets, in new each one. Note: // the 3rd parameter is the the page that user goes to // after successful login. Ensure the paths are correct. // Make this "" if user has no personal page. //---------------------------------------------------------------- // Login Functions //---------------------------------------------------------------- function login(username,password){ var member = null; var loggedin = 0; var members = users.length; for(x=0;x'); document.write(''); document.write(''); document.write(''); if(imgSubmit == ""){ document.write('
'); document.write('UserID:
Password:

'); } else { document.write('

'); } if(imgReset == ""){ document.write(''); } else { document.write(''); } document.write('

'); }