Best language for displaying a text file's data in an html page

I don't have cgi access, but I am allowed a script that writes form data to a text file that I do have access to. I'm looking for a way to display the text file's data in a web page. . like a guestbook. Using the <pre> tag would be acceptable too.
derhammAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

tconnollyCommented:
well if your hosting server allows Server Side Includes, then you could use an SSI command to bring in the text file. No real special coding required, just go about coding your page and then when you want to bring in the contents of the text file, put the following code in:


<!--#include file="textfile.txt" -->

you could even control formatting (albeit somewhat limited) by surrounding the command with <p> tags or other tags and use CSS to control the properties

the only other thing to remember is yto name your files with a .shtml extension...

hope this helps:)

TomC
0
derhammAuthor Commented:
Sounds great. Tried it but the text isn't displayed. I'm sure it's because the 80Megs of free webspace Earthlink provides it's broadband subscribers doesn't include SSI. Haven't read that anywhere but I assume it's probably the case. Just in case, is there something I need at the head of my .shtml code? Thanks for the info.
0
tconnollyCommented:
copy and paste the code for me so i can check... also do you have any details on what earthlink provides you or if you give me your url, i can try to see what type of server your site is on and perhaps i can give you more info
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

derhammAuthor Commented:
Here's the link:
http://home.earthlink.net/~denhamm/append.shtml

Here's the code:
<html>
<head>
<title>Sample Form</title>
</head>

<body>
<h1>Sample Form</h1>
<hr>

<form method="post" action="http://home.earthlink.net/cgi-bin/appendto">
<input type="hidden" name="appendfile" value="data/formresults.txt">
<input type="hidden" name="thankURL" value="http://home.earthlink.net/~denhamm/append.shtml">
<p><b>Name:</b><input type="text" name="name" size="30">
<br><b>Email:</b><input type="text" name="email" size="30"><p>
<b>Comments:</b>
<br><textarea name="comments" rows="10" cols="50"></textarea>
<p><input type="submit" value="Send">
<input type="reset" value="Clear">
</form><p>
<hr>

<!--#include file="data/formresults.txt" -->

</body>
</html>
0
derhammAuthor Commented:
Here's the link:
http://home.earthlink.net/~denhamm/append.shtml

Here's the code:
<html>
<head>
<title>Sample Form</title>
</head>

<body>
<h1>Sample Form</h1>
<hr>

<form method="post" action="http://home.earthlink.net/cgi-bin/appendto">
<input type="hidden" name="appendfile" value="data/formresults.txt">
<input type="hidden" name="thankURL" value="http://home.earthlink.net/~denhamm/append.shtml">
<p><b>Name:</b><input type="text" name="name" size="30">
<br><b>Email:</b><input type="text" name="email" size="30"><p>
<b>Comments:</b>
<br><textarea name="comments" rows="10" cols="50"></textarea>
<p><input type="submit" value="Send">
<input type="reset" value="Clear">
</form><p>
<hr>

<!--#include file="data/formresults.txt" -->

</body>
</html>
0
derhammAuthor Commented:
Here's the link:
http://home.earthlink.net/~denhamm/append.shtml

Here's the code:
<html>
<head>
<title>Sample Form</title>
</head>

<body>
<h1>Sample Form</h1>
<hr>

<form method="post" action="http://home.earthlink.net/cgi-bin/appendto">
<input type="hidden" name="appendfile" value="data/formresults.txt">
<input type="hidden" name="thankURL" value="http://home.earthlink.net/~denhamm/append.shtml">
<p><b>Name:</b><input type="text" name="name" size="30">
<br><b>Email:</b><input type="text" name="email" size="30"><p>
<b>Comments:</b>
<br><textarea name="comments" rows="10" cols="50"></textarea>
<p><input type="submit" value="Send">
<input type="reset" value="Clear">
</form><p>
<hr>

<!--#include file="data/formresults.txt" -->

</body>
</html>
0
tconnollyCommented:
ok, well it appears that earthlink is running an Apache web server on a Unix platform, so you could probably try PHP...

so rename your file with a .php extension and to insert your text, use the following code...

<?php
   include("data/formresults.txt");
   ?>
0
derhammAuthor Commented:
Thanks for your help tconnolly. PHP doesn't seem to work either. I think Earthlink strips us free webspace users of the basic extras most webmasters get like custom cgi, php, ssi, etc... I appreciate your help and if I don't get a working workaround in a few days I'll accept your php as an answer. Could you tell me what steps you took to find the web server and platform Earthlink is running? Thanks again.
0
tconnollyCommented:
http://uptime.netcraft.com/up/graph/

find the form on the left hand side that says

"what's that site running?"
0
Shalom CarmelCTOCommented:
Hi derhamm,
Let's suppose that yot text file is called "myfile.txt".
The following HTML code will work with any provider and display your text on any IE versions 4 and up.

<iframe  src="myfile.txt" height="100" width="100%" name="textfile" frameborder="no" scrolling="auto"/>

you can muck around with the attributes to find what suits you best.


ShalomC
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
derhammAuthor Commented:
Cool! I hadn't researched that tag yet. Anything work in Netscape? I could have some javascript determine the browser and display one or the other. If nothing works in Netscape I'll just have the script write an option to open a window containing the text file.
0
tconnollyCommented:
iframes are not supported in older versions of netscape (les than 6)
0
derhammAuthor Commented:
Cool! I hadn't researched that tag yet. Anything work in Netscape? I could have some javascript determine the browser and display one or the other. If nothing works in Netscape I'll just have the script write an option to open a window containing the text file.
0
Shalom CarmelCTOCommented:
IE and Netscape 6 are more than 95% according to this site.

http://www.w3schools.com/browsers/browsers_war.asp

My experience shows even a larger share.

ShalomC
0
derhammAuthor Commented:
I ended up using the <iframe> tag to solve my issue.

<iframe  src="myfile.txt" height="300" width="400" name="textfile" frameborder="no" scrolling="auto"></iframe>

Thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.