Click to See Complete Forum and Search --> : Option Selector


Lebron Letchev
05-12-2005, 06:24 PM
Hi,


I am thinking in use OPTION SELECTOR <select></select><option</option) for reading links storaged inside a .txt file.

Do you have some script done for doing this task?
I will be very grateful for any helpful.

Thanks

LLetchev

phpnovice
05-12-2005, 07:42 PM
The following is an example of reading a server-side text file, line-by-line, and outputing those lines to the HTML page:

<%
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim objFSO, objOpenFile, lno, txt
set objFSO = Server.CreateObject("Scripting.FileSystemObject")
set objOpenFile = objFSO.OpenTextFile(Server.MapPath("/folder/textfile.txt"), ForReading, False, False)
Response.Write "<p>"
Do Until objOpenFile.atEndOfStream
txt = objOpenFile.ReadLine
lno = lno + 1
Response.Write lno & ".&nbsp;&nbsp;" & txt & "<br>" & vbCrLf
Loop
objOpenFile.Close
Set objOpenFile = Nothing
Set objFSO = Nothing
Response.Write "<br>Total: " & lno & "</p>" & vbCrLf
%>