Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > can html display text file data?

Reply
Thread Tools

can html display text file data?

 
 
Shantha
Guest
Posts: n/a
 
      11-22-2003
I would like to keep my data in a simple text file and use them
to display in a html table. Is it possible? How?

Thanks!


 
Reply With Quote
 
 
 
 
Toby A Inkster
Guest
Posts: n/a
 
      11-22-2003
Shantha wrote:

> I would like to keep my data in a simple text file and use them
> to display in a html table. Is it possible? How?


Using server-side scripting. For example, in PHP, if you create a template
called template.php such as:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<title><?php echo $_GET['page']; ?></title>
<style type="text/css">
table { border: thick dotted green; }
</style>
<body>
<h1><?php echo $_GET['page']; ?></h1>
<ul>
<li><a href="template.php?page=myfile1.txt">myfile1.txt</a></li>
<li><a href="template.php?page=myfile2.txt">myfile2.txt</a></li>
<li><a href="template.php?page=myfile3.txt">myfile3.txt</a></li>
</ul>
<table><tr><td><pre><?php include($_GET['page']); ?></pre></td></tr></table>
</body>

Then call it like:

template.php?page=myfile1.txt

For example:

http://www.goddamn.co.uk/tobyink/scr...ge=myfile1.txt

With the real data being stored here:

http://www.goddamn.co.uk/tobyink/scratch/myfile1.txt
http://www.goddamn.co.uk/tobyink/scratch/myfile2.txt
http://www.goddamn.co.uk/tobyink/scratch/myfile3.txt

--
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?page=132
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Save and then display msword documents as html, filtered html, single file .mht or pdf. AAaron123 ASP .Net 1 11-17-2009 10:02 AM
using dreamweaver : how can I insert HTML file into another html file? johnsonholding@yahoo.com HTML 3 01-10-2006 08:06 PM
CHtmlView: How to read html text before display, change and give to display changed html code? Marek Kurowski C Programming 1 08-18-2004 06:41 PM
how can I write text from codebehind to html - without html rendering Alex Papadimoulis ASP .Net 3 05-06-2004 02:30 PM
OT?: Word wrap in text files opened in MSIE (re HTML links in an html index file). fitwell HTML 2 11-13-2003 03:14 PM



Advertisments