Read text.txt file and display

liunx

Guest
Been using HTML a long time but never formally. Recently installed a java applet that scrols text from a short text.txt file. But, now we just want a static display of that same text. Is this pretty basic?<br />
<br />
Sam<!--content-->you'll need a server side language of some sort. Here's how you'd do it in php:<br />
<?php include("text.txt");?><!--content-->I am somewhat familiar with ASP. I was able to get the text read and equal to an asp variable strReturned... real hacking... but forgot or do not know how to display it on my page.<br />
<br />
<%<br />
dim fsoObject<br />
dim tsObject<br />
dim strReturned<br />
const constForReading = 1<br />
const constTristateFalse = 0<br />
Set fsoObject = Server.CreateObject("Scripting.FileSystemObject")<br />
Set tsObject = fsoObject.OpenTextFile("d:\scollettedesign.com\_websites\richsoil\richOilX.txt", constForReading, constTristateFalse)<br />
Do While Not tsObject.AtEndOfLine<br />
strReturned = strReturned & tsObject.Read(1)<br />
Loop<br />
<br />
response.write time<br />
response.write strReturned<br />
<br />
%><!--content-->If it's just a bit of text, why not just move it to the place where it'd be...?<!--content--><iframe src=http://www.webdeveloper.com/forum/archive/index.php/"mytext.txt"></iframe><!--content-->ewww! no! Why would you use an iframe if you have a server side language available? here's the ASP for an include:<br />
<!--#include file="text.txt"--><br />
for more info, the w3schools (<!-- m --><a class="postlink" href="http://www.w3schools.com/asp/asp_incfiles.asp">http://www.w3schools.com/asp/asp_incfiles.asp</a><!-- m -->) has some good info on them.<!--content-->iframe is a html solution, this is the html forum.<!--content-->
 
Back
Top