How do I create a password protected page?

mgonzo

New Member
This is a html to password protect a website
where is says text put the username
where it says password enter a password
where it says protected page,thats the page you want protected


if you need further help drop me a line.



<script language="javascript">
<!--//
/*This Script allows people to enter by using a form that asks for a
UserID and Password*/
function pasuser(form) {
if (form.id.value=="text") {
if (form.pass.value=="password") {
location="protected page.html"
} else {
alert("Invalid Password")
}
} else { alert("Invalid UserID")
}
}
//-->
</script>

<center>
<table bgcolor="white" cellpadding="12" border="1">
<tr><td colspan="2"><center><h1><i><b>Login
Area</b></i></h1></center></td></tr>
<tr><td><h1><i><b>UserID:</b></i></h1></td><td><form name="login"><input
name="id" type="text"></td></tr>
<tr><td><h1><i><b>Password:</b></i></h1></td><td><input name="pass"
type="password"></td></tr>
<tr><td><center><input type="button" value="Login"
onClick="pasuser(this.form)"></center></td><td><center><br><input
type="Reset"></form></td></tr></table></center>
 
Last edited:

mgonzo

New Member
Kiwiberry said:
Not sure about the code above, but [tab] probably has the easiest solution. the .htaccess file

YES IT WORKS

their both easy ............... for me html is easiest.
 

gateshosting

New Member
Well, if it was me, and I wanted to get into the page without typing in a password, which is usually how my mind works, I Would look at the source to see how you password protect the page. Then I would see it clearly in the javascript. Even if your javascript is just an include.

Do you know ASP, or have access to the server? If you have access to the server, you can make a directory password protected with IIS. Otherwise, if you host with another company, they usually give you the option of creating password protected pages.

Michael C. Gates
GatesHosting.com
Web Hosting
 

garry2005

New Member
Login Security...

A possible answer: If your webhoster offers cPanel, it's more than likely that the cPanel already offers a php Login device...all you do is install it in about 1.222 seconds! I stuggled with the same issue with my own website, and the soultion was staring me right in the face all along. Feel free to check it out, if you wish: Go to http://www.lewisaire.com, then to Operations Center, and then try to acces Download Center...can't get much easier than this.

Garry
 
Top