|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
I have a an ASP page on which i wish to load dynamic text by way of a dot text file. It would be great if something like.- <txt scr = "MyTextFile.txt"> existed but life aint that simple, or is it? Any pointers would be much appreciated. Thanks in advance, Mave |
|
#2
|
|||
|
|||
|
You'll probably want to use the FileSystemObject (FSO) to read from the text file, and output what is read in. Take a look into that.
|
|
#3
|
|||
|
|||
|
Is this what you mean?
You can perform a server side include of your text file with this syntax
<!--#include file="includes/fileName.txt" --> The file can contain HTML for formatting if you wish. If you have a choice (you arent using asp to view server error logs or something), rather than using a txt file on the server you should put the info in a db. Just my .02 Jeff http://www.webfootss.com |
|
#4
|
|||
|
|||
|
Oh and btw
The last post is correct use the include file, but don't forget to set your permmisions for that file!
Mydasx |
|
#5
|
|||
|
|||
|
I'll give both mehtods a try.
1. Does the #include function actually display text to the screen automatically or should I put some other tags round it, or tags in the .txt document? And how do I alter the permissions? 2. A large DB field with the text in sounds like a quick simple fix, are there any problems with doing it this way? Thanks for your help! ![]() |
|
#6
|
|||
|
|||
|
if you don't already know sql, then the simplest thing to do is use the include,
and no you don't need any other tags, unless you want to format whatever text is in the txt file.. the put the tags right into the txt file. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Loading .txt in ASP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|