<%OPTION EXPLICIT%>
<html>
<head>
</head>
<body>
<%
Dim TabStop, NewLine, newFilePath, newDrive, newFileName, newInput, title, newFolder, TextStream
function FormatStr(fString)
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10) & CHR(10), "</P><P>")
fString = Replace(fString, CHR(10), "<BR>")
FormatStr = fString
end function
' stien hvor filen skal oprettes, samt ny mappe
newFilePath = "W:\tingeling\" & request("filepath")
' navn på filen som skal oprettes. tilføjet .htm !!
newFileName = request("blablabla") & ".html"
newInput = request("indhold")
newInput = FormatStr(newInput)
title = request("title")
' ********************* Create folder, file and text in file ************
Function Create(FSO)
' **** create folder, file and text in file ****
Set FSO = CreateObject("Scripting.FileSystemObject")
Set newFolder = FSO.CreateFolder(newFilePath)
Set TextStream = FSO.CreateTextFile(newFilePath & "\" & newFileName)
TextStream.WriteLine("<html>")
TextStream.WriteLine("<head>")
TextStream.WriteLine("<title>")
TextStream.WriteLine(title)
TextStream.WriteLine("</title>")
TextStream.WriteLine("</head>")
TextStream.WriteLine("<body>")
TextStream.WriteLine("<b>")
TextStream.WriteLine("<H1>" & newInput & "</H1>")
TextStream.WriteLine("</b>")
TextStream.WriteLine("</body>")
TextStream.WriteLine("</html>")
TextStream.Close
End Function
Create(newFileName)
' ***********************************************************************
response.redirect newFilePath & "\" & newFileName
%>
</body>
</html>
Dette er gemt i filen df.asp på
http://localhost på min computer - så der skulle da ikke være noget galt? (localhost (eller
http://wulff) ligger på W: