Computer Hope

Other Pages

Home
Site map
Computer help

Dictionary
News
Q&A
What's new

Tools

E-mail this page
Print Preview
Edit this page




 

Easy password for site

Example

Example shown when this page is opened. This script will encounter issues if placed on the same page as the destination page (such as we have done on this page). When implementing this we recommend you place this on a page of its own and direct the correct password users to another page.

Keep in mind that this password is not a recommended method for sites that need to be 100% secure as experienced users can easily bypass this.

If you are looking for a 100% secure method of implementing passwords you will need to create a .htaccess file on the server containing the security information. Additional information on how to do this can be found through your ISP (if supported).

Source code

<script language="Javascript">

<!--

var password = "please"
var x = prompt("Enter in the password "," ")
if (x.toLowerCase() == password) {
alert("Come right in \n \n You've entered in the right password")
location = "index.htm"
}

else {
location = "bad.htm"
}

//-->

</script>

Index

Category:
Cool Tricks

Companies:
None

Related Pages:
HTML Help

Resolved

Were you able to locate the answer to your questions?

Home - Computer help - Contact - Dictionary - Links
Link to Computer Hope - Bookmark Computer Hope