For a guide to the choosing ASP or PHP, click here
Home >> Text Files >> Reading from a Text File This code shows how to read in the contents of a text file and save it to a variable.
<% ' declare our variables dim fso dim file1 dim ourFile dim fileContents ' this is the file to read from ourFile = "Filename.txt" ' this will open the file and read the contents Set fso = CreateObject("Scripting.FileSystemObject") Set file1 = fso.CreateTextFile(Server.MapPath(ourFile), True) fileContents = file1.readall file1.close ' this cleans up our objects set file1 = nothing set fso = nothing ' our file is now stored in variable: fileContents %> What is ASP?
What is PHP?