<% '################################################################################# '## F L O G I N '## Flogin Release Beta Version 1.1 '## Last Edited on 19 September 2003 '## Copyright (C) 2003 Mohammed Faizul Wahid '## Send email at faiz_wahid@yahoo.com '## This program is free software; you can redistribute it and/or '## modify it under the terms of the GNU General Public License '## as published by the Free Software Foundation; either version 2 '################################################################################# '## H O W T O U S E '## '## 1. To identify a Valid or Invalid login use Session("LoggedIn")similar VB code as below, '## '## if Session("LoggedIn") = fsecstr then '## Response.Write "User is Logged In" '## else '## Response.Write "User is not Logged In" '## end if '## '## '## 2. To identify a which user is logged in use the session variable Session("LoginName") '## '################################################################################# dim flogin_content, flogout_text, flogin_text dim ferr, fscript, flogin_do, fsecstr, fi dim fUName(2), FPword(2) 'Suffix for both should be max users - 1 FUName(0) = "adhenderson" 'Username for User 1 FPWord(0) = "KPforest1" 'Password for User 1 'Modify the subsequent lines only if you are sure of what you're doing! fsecstr = "123893736535" fscript = Request.ServerVariables("Script_Name") flogout_text = "

" & vbNewLine & _ " You are logged in! " & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ "
" flogin_text = "
" & vbNewLine & _ "
Username " & vbNewLine & _ " Password " & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ "
" if Session("LoggedIn") = fsecstr and not Request.QueryString = "logout" then flogin_content = flogout_text else flogin_do = Request.Form("do") if not Request.QueryString("ferr") = "" or Request.Form("do") = "" then flogin_do = "showbox" end if select case flogin_do case "showbox" flogin_content = flogin_text case "login" fmaxU = Ubound(FUName) fmaxP = Ubound(FPword) 'Raise error if usernames and corresponding passwords are not properly set if fmaxU <> fmaxP Then flogin_content = "Improper User Setup" end if fi = 0 for fi = 0 to fmaxU if Trim(Request.Form("login")) = FUName(fi) and Trim(Request.Form("password")) = FPword(fi) then Session("LoggedIn") = fsecstr Session("LoginName") = FUName(fi) flogin_content = flogout_text fi = fmaxU else flogin_content = "Invalid Login" & flogin_text end if next case "logout" Session("LoggedIn") = "Falze" flogin_content = flogin_text end select end if flogin_content = "" & flogin_content & "" Response.Write(flogin_content) if Session("LoggedIn") <> fsecstr then Response.End end if %> <% If Session("LoggedIn") = fsecstr Then Select case Session("LoginName") case "adhenderson" %>
<% end select End If %>