ASP JEmail Password Protected

Example ASP script for password protecting pages.

To password protect a directory you can use the following method:

Create a page called index.asp as follows (replace guest and login with your own username and password)...
<%
msg = ""
If Request("Submit") <> "" Then
If Request("username") = "guest"
And Request("password")="login" Then
Session("Valid") = Request("username")
'first protected page here
response.redirect "nextpage.asp"
Else msg = "Invalid username or password. Try again!"
End If
End If
%>
<html>
<head>
<title>Password Protect</title>
</head>
<body>
<form action="index.asp" method="post">
<table>
<% If msg <> "" Then %>
<tr><td colspan="2"><font color=red><%=msg%></font></td></tr>
<%End If%>
<tr>
<td>UserName:</td>
<td><input type="text" name="UserName"></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="Password" name="Password"></td>
</tr>
<tr>
<td colspan="2"><input type="submit" name="Submit"></td>
</tr>
</table>
</form>
</body>
</html>

On top of every ASP page you want to protect in the directory add the following function...
<%
If Session("Valid") = "" Then
Response.redirect "index.asp"
End If
%>
Any page with this in it will not allow the user to view it unless they are logged in!

Parts in bold need to be changed to suit your needs
Logo of Edelweiss   Mahindra Logo   Logo of IDBI   Himalayan Logo   ICICI Foundation Logo   Camlin Kokuyo Logo   Logo of Okaya   Microtek Logo   Logo of Action Tesa   Wonderchef company Logo   Vichare Express & Logistics Pvt Ltd Logo   Logo of Bonanza Bullion Private Limited   Globetech Logo   Mascot Universal Logo   Logo of Connell Bros   GDA Trusteeship Ltd Logo   Asian Logo   ROGER Car Techssories Logo   Elite International Logo   Charminar Logo   Logo of Brave   Goldmedal Logo   Logo of Slider Bearings   National College Logo   Mafatlal Logo   Krishgen Logo    
E-mail : sales@virtualsplat.com
Phone : +91-9892413501

+91-9967648641

+91-9967648641

Facebook Google+ Linkedin Twitter