% option explicit %> <% ' Check if the user is logged in or not varChkPass = Request.Cookies("ChkPass") If varChkPass = "adminaccess" then myFolder= request.querystring("album") If myFolder <> "" then imagetextfilepath = "text\"&myFolder&".txt" myFolderPath = Server.MapPath(myFolder) ' ' ' Set objFSO = CreateObject("Scripting.FileSystemObject") If (objFSO.FolderExists(myFolderPath)) and myFolder <> "text" and myFolder <> "images" Then Set objFolder = objFSO.GetFolder(myFolderPath) Else response.redirect "login.asp" End If '-------------------------------------------------------------------- 'check if the form was submitted or not submitcheck = request.form("submit") If submitcheck <> "" then totalpics = request.form("totalpics") 'response.write "form submitted "& totalpics 'Here is where we write to the text file 'Set variables For i = 1 to totalpics textdescription = textdescription + request.form("text"&i&"") + "##" Next response.write textdescription 'create the string 'Check if the folder exists and create it if necessary Set objFSO = CreateObject("Scripting.FileSystemObject") If NOT objFSO.FolderExists(myFolderPath&"\..\text") Then objFSO.CreateFolder(myFolderPath&"\..\text") objFSO.CreateTextFile(myFolderPath&"\..\"&imagetextfilepath) Else 'Make sure the file exists and create it if necessary If NOT objFSO.FileExists(myFolderPath&"\..\text\"&myFolder&".txt") Then objFSO.CreateTextFile(myFolderPath&"\..\"&imagetextfilepath) End if End If 'write it to the file set f = objFSO.OpenTextFile(myFolderPath&"\..\"&imagetextfilepath, ForWriting, True) f.Write textdescription f.Close set f = nothing set objFSO = nothing 'refresh the page response.redirect "admin.asp?album="& myFolder Else 'response.write "NO form submitted" End if '---------------------------------------------------------------------- %>