Tours

Get Involved

Faqs

Faqs

FOUNDATIONS LOGIN AREA


<% '==================================================================== '==================================================================== '==================================================================== 'Preferences LoginName = "cavt" Password = "2220" 'Directory and XMLFilename must already exist '(don't forget to give "Modify" permissions to default IIS user) Directory = "C:\websites\wadedesigninc.com\gallery\" XMLFilename = "images.xml" '==================================================================== '==================================================================== '==================================================================== Function StripFileName(ByVal asPath) If asPath = "" Then Exit Function asPath = Replace(asPath, "/", "\") If InStr(asPath, "\") = 0 Then Exit Function If Right(asPath, 1) = "\" Then Exit Function StripFileName = Right(asPath, Len(asPath) - InStrRev(asPath, "\")) End Function if Request.Form("Action") = "Log In" then if Request.Form("LoginName") = LoginName and Request.Form("Password") = Password then Session("LoginName") = LoginName Response.Redirect "Foundations.asp" else Response.Write "Incorrect Login/Password." Response.End end if elseif Request.Form("Action") = "Logout" then Session.Abandon() Response.Redirect "Foundations.asp" elseif Request.Form("Action") = "Add" then PhotoName = StripFileName(Request.Form("PhotoToAdd")) Set fs = Server.CreateObject("Scripting.FileSystemObject") Set f = fs.OpenTextFile(Directory & XMLFilename, 1) XMLData = f.ReadAll XMLData = LCASE(XMLData) XMLData = Replace(XMLData, "", "" & vbcrlf & "") f.Close Set f = fs.CreateTextFile(Directory & XMLFilename, True) f.Write(XMLData) Set f=Nothing Set fs=Nothing Response.Write "Your photo has been added to the XML. Don't forget to upload the file.

Click to return to maintenance." Response.End elseif Request.Form("Action") = "Delete" then PhotoName = Request.Form("PhotoToDelete") Set fs = Server.CreateObject("Scripting.FileSystemObject") Set f = fs.OpenTextFile(Directory & XMLFilename, 1) XMLData = f.ReadAll XMLData = LCASE(XMLData) XMLData = Replace(XMLData, "" & vbcrlf, "") f.Close Set f = fs.CreateTextFile(Directory & XMLFilename, True) f.Write(XMLData) Set f=Nothing Set fs=Nothing Response.Write "Your photo has been removed from the XML.

Click to return to maintenance." Response.End end if if Session("LoginName") <> LoginName then %>

Username:

Password:

   
 



<% else %>

<% end if %>

Become a Member