IOLS.COM (Inet OnLine Services)
Cheap internet access, web site hosting, web site design, web site administration, web site promotion serving all 50 states in the USA including Illinois, New York, California, Texas, Florida, Indiana, New Jersey, Oregon, Washington, Montana, Idaho, Arizona, New Mexico, New Hampshire, Vermont, Maine, Massachusettes, Maryland, Virginia, Gerogia, Ohio, Wisconsin, Iowa and more.

IOLS Web Site Design Services

Learn More About Web Design

How Do I Password Protect A Web Page
Please send your insights and ideas via email to webmaster@iols.net
Click here for a demoClick here to see a demo

Disclaimer:
The script presented and information on this page will help to protect a page from entry
and is not intended to be a secure end all solution to password protecting a web page
or web site.  Please consult us for secure solutions to achieve that goal.

Here's a very easy way to password protect a web site using JavaScript.

Compliments of JavaScripts.com
(http://www.javascripts.com)
A great resource for javascripts!

Just copy and past the code below into your web page noting the changes required shown in the comments above each line to change

<!-- This script has been in the http://www.javascripts.com Javascript Public Library! -->
<!-- Note that though this material may have been in a public depository, --> 
<!-- certain author copyright restrictions may apply. -->
<html>

<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<title>Password Required</title>
<script>
//remove the line below from your page
alert("the password is enter")
//we will first ask the user if he would like to continue into this restricted area
var p=confirm("this site is pass word protected, do you still want to enter?")
if(p){ 
//var ans="password" input your password here between the quotes
var ans="enter"
var pass=prompt("what is the pass word")
if(pass!==ans)
{
alert("wrong you will now be transferred")
//edit the URL below
window.location="http://www.iols.com"
}else{alert("correct");}
//edit the URL below
}else{window.location="http://www.iols.com"}
</script>
</head>

<body bgcolor="#FFFFFF">
<script language="Javascript1.2">

// The following code prevents right clicking and viewing 
// the source code of the page
// Script provided by The IOLS Design Team www.iols.com/design

// Set the message for the alert box
am = "This function is disabled!";

// do not edit below this line
// ===========================
bV  = parseInt(navigator.appVersion)
bNS = navigator.appName=="Netscape"
bIE = navigator.appName=="Microsoft Internet Explorer"

function nrc(e) {
   if (bNS && e.which > 1){
      alert(am)
      return false
   } else if (bIE && (event.button >1)) {
     alert(am)
     return false;
   }
}

document.onmousedown = nrc;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (bNS && bV<5) window.onmousedown = nrc;

</script>
</body>
</html>

Click here for a demoClick here to see a demo

For more great JavaScripts visit
JavaScripts.com
(http://www.javascripts.com)

More Design Tips

Please send your insights and ideas via email to webmaster@iols.net

 
IOLS simplifies the task of starting a new business or expanding your existing business with easy to use low cost solutions.
 Web Design Tips

 Learn More About Web Design
 - Is your content good enough?
 - Get your web site in shape.
 - Password protect a page?
 - Add contact information
 - Meta tags.
 - Meta Tag Generator
 - Assess/improve your web site
 - Redirect your visitors
 - HTML Color Picker


 IOLS Web Design Services

 - Domain Name Registration
 - Web Site Design
 - Web Site Development
        & Administration
 - Web Site Promotion
 - Web Site Hosting
 - Graphic Design
 - Internet Access
 - Web Design Templates
 - Ecommerce Design
 - Learn More About Web Design
 

 Web Site Hosting
    
Hosting plans
     Add-on Services
     See The Admin GUI
     for Your Web Site
     Solutions
     Support
     Turn-key Starter Plans
     Order Now

 Web Site Design & Admin
     Web Site Design

 Dedicated Server Hosting
     Be in control of
     your own server

 Domain Name Services
     Free Domain Names
     Lookup a Domain Name
     Register a Domain Name
     Order Now

 E-commerce
     The world's most advanced
     easy to use secured online
     shopping system
     Free Trial
     Order Now
   
  Internet Access
     Unlimited Internet Access
     ISDN (128k) Internet Access
     High Speed Wireless Access!
               (Up to 2 Mbps)
     Filtered Internet Access
     DSL Services
     Dialup Access Numbers

 

 

 

Internet Access     DSL     Web Site Hosting & Design     Dedicated Servers     Business Solutions
Ecommerce      Member Services      Tech Support      Dialup Access Numbers      Jobs     Awards

Buy Services      Contact Us / Company Information      Search      Site Map

 
©1995 - 2009 Inet OnLine Services (IOLS)   |   Privacy Policy Back   |   Home