Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Anybody know how to make a Login/Password thingy?? 1

Status
Not open for further replies.

jerryx

ISP
Aug 5, 1999
5
CA
Just wondering what is the easiest way to do a Login/Password thing like Hotmail or a link to a protected site...I am experimenting how to do it...is CGI-Bin the only way to do it???
 
CGI is not the only way.<br>
Some use app servers like Cold Fusion, PHP, ASP etc..<br>
<br>
but the idea is always to have a program or script to take in the input value<br>
and check it against data stored in database, flat files etc.
 
just copy the index.html below and the verify.asp below and modify accordingly..and you will be up..

and if you want to prevent bookmarking use this line at the top of every one of your pages...

<script language=&quot;vbscript&quot;>
if session(&quot;allow&quot;)<>&quot;True&quot; then response.redirect &quot;index.html&quot;
</script>

this works for us.. Hope it helps!

Thanks
Chris
Apex Internet Development

here is index.html for the /admin directory

<html>

<head>

<title>Website Maintenance</title>

<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<style fprolloverstyle>A:hover {color: #FF0000}
</style>
</head>



<body bgcolor=&quot;#FFFFFF&quot; onLoad=&quot;&quot; link=&quot;#FF0000&quot;>
<table border=&quot;0&quot; cellspacing=&quot;1&quot; cellpadding=&quot;1&quot; align=&quot;center&quot;>
<tr>

<td height=&quot;22&quot;>

<table width=&quot;675&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;>
<tr>

<td>
<p align=&quot;center&quot;><img border=&quot;0&quot; src=&quot;../images/logo2.jpg&quot; width=&quot;140&quot; height=&quot;104&quot;></p>
</td>

</tr>

</table>

</td>

</tr>

<tr>

<td height=&quot;16&quot; align=&quot;center&quot;>
<hr>
<p><b><font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#000000&quot;>Welcome
to Site Maintenance Utility</font></b> </td>

</tr>

<tr>
<td height=&quot;2&quot;>
<div align=&quot;center&quot;><font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#000000&quot;>Please
login to access your account -</font></div>
</td>
</tr>
<tr>
<td height=&quot;113&quot;>
<form method=&quot;post&quot; action=&quot;verify.asp&quot; name=&quot;login&quot;>
<div align=&quot;center&quot;>
<div align=&quot;center&quot;>
<center>
<table border=&quot;0&quot; cellpadding=&quot;4&quot;>
<tr>
<td><font face=&quot;Arial&quot; color=&quot;#000000&quot;>Username:</font></td>
<td><font face=&quot;Arial&quot; color=&quot;#000000&quot;><input type=&quot;text&quot; name=&quot;username&quot; size=&quot;20&quot; value=&quot;&quot;></font></td>
</tr>
<tr>
<td><font face=&quot;Arial&quot; color=&quot;#000000&quot;>Password:</font></td>
<td><font face=&quot;Arial&quot; color=&quot;#000000&quot;><input type=&quot;password&quot; name=&quot;password&quot; size=&quot;20&quot; value=&quot;&quot;></font></td>
</tr>
</table>
</center>
</div>
<font color=&quot;#000000&quot;>Password already entered for demo
version.&nbsp; Click Login to Login to management area!<br>
<br>
<input type=&quot;submit&quot; name=&quot;B1&quot; value=&quot;Login&quot;>
</font> </div>
</form>

</td>
</tr>

<tr bgcolor=&quot;#FFFFFF&quot;>

<td align=&quot;center&quot;>

<hr>
</td>

</tr>

</table>

</body>

</html>






here is the verify.asp script:

<%@Language=VBScript%>
<%Response.Buffer = True%>
<%
Response.Expires = 60
Response.Expiresabsolute = Now() - 1
Response.AddHeader &quot;pragma&quot;,&quot;no-cache&quot;
Response.AddHeader &quot;cache-control&quot;,&quot;private&quot;
Response.CacheControl = &quot;no-cache&quot;
UserName = request(&quot;username&quot;)
Password = request(&quot;password&quot;)
if UserName=&quot;your username&quot; and Password=&quot;your password&quot; then
session(&quot;allow&quot;)=&quot;True&quot;
'//*********** PUT THE CONTENTS OF YOUR WEB PAGE HERE *********//
response.redirect &quot;main.html&quot;
else
response.write &quot;<script language=&quot;&&quot;Javascript>alert(&quot;&&quot;'Invalid Account Information!');&quot;&chr(10) & chr(13) & &quot;location=&quot; & &quot;'index.html'&quot;&&quot;;</script>&quot;
End If
%>

<head>
<title></title>
<style fprolloverstyle>A:hover {color: #FF0000}
</style>
</head>

<body bgcolor=&quot;#000000&quot; text=&quot;#FFFFFF&quot;>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top