Protecting a folder

What sort of casual access? If you are looking to create password protected directories, that is unfortunately only available on Windows.
 
Yash said:
What sort of casual access? If you are looking to create password protected directories, that is unfortunately only available on Windows.

I am on Windows and a password protected directory will be just fine. But, I thought you meant linux in above reply:) Thanks.
 
On windows, you can just use a simple asp script to password protect a directory and then redirect if they're not logged in. If you need I code like this I will be glad to post one.
 
Bliss said:
On windows, you can just use a simple asp script to password protect a directory and then redirect if they're not logged in. If you need I code like this I will be glad to post one.

Yes, please do. I'd love to get a solution. Thanks!
 
This is a simple login page and you can name it whatever.asp and put it anywhere on your site. Just a script I found somewhere. Change the stuff in extra bold to what you want.

<%@ LANGUAGE="VBSCRIPT" %>
<%
Response.Buffer = True
STATUS = Request("STATUS")
PASSWORD = Request("PASSWORD")


If STATUS = "CHECKEM" Then
If PASSWORD = "sample" THEN
Session("PASSWORDACCESS") = "Yes"

Response.Redirect("youpage.asp")
End If
End If


If Session("PASSWORDACCESS") <> "Yes" Then
%>
<HTML>
<BODY bgcolor="#FFFFFF">
<form method="POST" action="thispage.asp">
<div align="center"><center><p><input type="password" name="PASSWORD" size="10"><br>
<input type="hidden" value="CHECKEM" Name="STATUS" >
<input type="submit" value="Login"></p>
</center></div>
</form>
</BODY>
</HTML>
<%
Response.End
End If
%>


Now on all the pages you want to protect (The extension must be .asp), write

<%
If Session("PASSWORDACCESS") <> "Yes" Then
Response.Redirect("Unauthorised.htm")
End If

%>
 
Back
Top