| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Login and Password Protection
<HTML>
<HEAD> <TITLE>Login and Password Protection</TITLE> <!------------------------------------------########## Script Part 1 ###################Copy this part into the HEAD of your page-------------------------------------------> <SCRIPT LANGUAGE=JAVASCRIPT> <!-- function key(pass) { //configuration: you may change the html // _ext to ".html" var html_ext = ".htm" //the file extension of the secured pages //configuration: the absolute or relativ // e path to the protected pages var path_to_secured_pages = "../common/" //don't forget the trailing slash //end of conf. var location = path_to_secured_pages+ pass + html_ext; this.location.href = location } //--> </SCRIPT> <!------------------------------------------########## End of Script Part 1 ############-------------------------------------------> </HEAD> <BODY bgcolor="black" text="cyan" link="#00FFFF" vlink="#C0C0C0"> <P align="center"><Img src="../../bitmaps/demo.gif" WIDTH="480" HEIGHT="43"></P> <CENTER><P><H2>Login and Password Protection</H2></P></CENTER> <P> this script offers perhaps the best type of password protection you can get using Javascript (it is still far less secured than proper server-side password protection). Here is how it works: the concatenation of the login and password form the name of the hidden page to be loaded. for example if <EM> Mon </EM> is the login and <EM> day </EM> is the password, then the system will attempt to load the page <EM>a_path/Monday.htm</EM>, where <EM>a_path</EM> is a configurable absolute or relative directory to the hidden pages. You may also configure the file extension of the hidden pages(".htm" or ".html").</P> <P> try <EM>Mon, Tue, Wednes, Thur, Fri, Satur</EM> or <EM>Sun</EM> as the login name and <EM>day</EM> as password. In this server, the login and password are case-sensitive. </P> <!------------------------------------------########## Script Part 2 ###################Copy this part into the BODY of your page-------------------------------------------> <CENTER><TABLE align="center" border="1" bgcolor="blue"> <TR><TD colspan="1" align="left"> <FORM NAME="password"> <FONT color="yellow" <P> Login <BR> <INPUT NAME="user" TYPE="text" SIZE="25"><BR> Password <BR> <INPUT NAME="pwd" TYPE="password" SIZE="25"> <BR><CENTER> <INPUT VALUE="Okay" TYPE="button" OnClick="key(document.password.user.value+document.password .pwd.value)"> </CENTER></FONT></FORM> </TD></TR> </TABLE></CENTER> <!------------------------------------------########## End of Script Part 2 ############-------------------------------------------> </BODY> </HTML> |
![]() |
| Viewing: ASP Free Forums > Programming > Code Bank > Login and Password Protection |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|