Code
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<script language="JavaScript" src="Number1.js">
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<p>usernames: username1 username2 password2</p>
<p>passwords: password1 password2 password3</p>
<p><input type="button" value="Try it!" onclick="LetUserIntoPage();"></p>
<p> </p>
<p>Script is as follows:</p>
<p>head section:</p>
<p>function LetUserIntoPage()<br>
{<br>
var username = prompt("Please enter your username:", "");<br>
var password = prompt("Please enter your password:", "");<br>
var TheLists = new Array(3)<br>
{<br>
TheLists[0] = "username1:password1";<br>
TheLists[1] = "username2:password2";<br>
TheLists[2] = "and so on:and so on";<br>
}<br>
for (i = 0; i < TheLists.length; i++)<br>
{<br>
if (TheLists[i].indexOf(username) == 0)<br>
{<br>
var TheSplit = TheLists[i].split(":");<br>
var TheUsername = TheSplit[0];<br>
var ThePassword = TheSplit[1];<br>
if (username == TheUsername && password == ThePassword)<br>
{<br>
alert("Welcome, " + username);<br>
// Your other commands here<br>
}<br>
}<br>
}<br>
}<br></p>
<p>Body section:</p>
<p>Append to body tag:</p>
<p>onload="LetUserIntoPage();"</p>
<p>END</p>
<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by <a href="http://www.webscriptexpert.com">Web Script Expert</a></font>
</center><p>
<!-- Script Size: 2.36 KB -->
<HEAD>
<script language="JavaScript" src="Number1.js">
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<p>usernames: username1 username2 password2</p>
<p>passwords: password1 password2 password3</p>
<p><input type="button" value="Try it!" onclick="LetUserIntoPage();"></p>
<p> </p>
<p>Script is as follows:</p>
<p>head section:</p>
<p>function LetUserIntoPage()<br>
{<br>
var username = prompt("Please enter your username:", "");<br>
var password = prompt("Please enter your password:", "");<br>
var TheLists = new Array(3)<br>
{<br>
TheLists[0] = "username1:password1";<br>
TheLists[1] = "username2:password2";<br>
TheLists[2] = "and so on:and so on";<br>
}<br>
for (i = 0; i < TheLists.length; i++)<br>
{<br>
if (TheLists[i].indexOf(username) == 0)<br>
{<br>
var TheSplit = TheLists[i].split(":");<br>
var TheUsername = TheSplit[0];<br>
var ThePassword = TheSplit[1];<br>
if (username == TheUsername && password == ThePassword)<br>
{<br>
alert("Welcome, " + username);<br>
// Your other commands here<br>
}<br>
}<br>
}<br>
}<br></p>
<p>Body section:</p>
<p>Append to body tag:</p>
<p>onload="LetUserIntoPage();"</p>
<p>END</p>
<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by <a href="http://www.webscriptexpert.com">Web Script Expert</a></font>
</center><p>
<!-- Script Size: 2.36 KB -->
