can html display text file data?

S

Shantha

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!
 
T

Toby A Inkster

Shantha said:
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/scratch/template.php?page=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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top