/* ------------------------------------------------------------------- Login Script Version 1.9 By H G Laughland http://www.laughland.biz DISCLAIMER: Use this script with caution. This script is not the most secure method available, for protecting material. Its main purpose is to demonstrate the javascript techniques used. The author takes no responsibility for data loss resulting from the use of this script. ------------------------------------------------------------------- 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 "images/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 = "category1_1.htm"; // The page users go to after login, if they have no personal page. var loginpage = "index.htm"; //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("ski","bargains","category1_1.htm"); // Change these two entries to valid logins. users[1] = new Array("ski1","bargains1",""); // Add addtional logins, straight after these, as // 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('Username:
Password:

'); } else { document.write('

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

'); }