|
<%response.buffer=true%>
<%
Dim strUserID
Dim strPassword
Dim bLoginOK
strUserID = Request.cookies("userID")
bLoginOK = false
'check if the login is ok
if (Len(strUserID) > 0) then
'here you should use a database or a COM component
bLoginOK = StrComp(strUserID, "CodeProject") = 0
end if
'if the login isn't correct redirect to the login page
if (not bLoginOK) then
Dim strFile
strFile = Mid(Request.ServerVariables("SCRIPT_NAME"), _
InStrRev(Request.ServerVariables("SCRIPT_NAME"), "/") + 1)
Response.Write "<form name=formLogin action='login.asp' method=post><input type=hidden name=destiny value='" & strFile & "'></form>"
Response.Write "<script language=JavaScript>"
Response.Write "document.formLogin.submit();"
Response.Write "</script>"
Response.End
end if
%>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
XicoLoko is a brazilian developer based in Switzerland.