Including text From Other Pages or Text Files

E

Elliot J

Hi all,

What I want to do is probably pretty basic, but as I've had no cause to look
into it previously, I'm currently a bit clueless.

Imagine I have a HTML front page (frontpage.htm), and a text file (test.txt)
on the same server.

I'm trying to find a way to link the text from test.txt into a table on my
front page, dynamically. So if I change the contents of test.txt then
refresh frontpage.htm, I can see the new text in the table.

To go one further, I would like to link certain blocks of text (ie: specific
contents of cells within a table) from a .htm file into my frontpage.htm
file in the same fashion.

I have been trawling the net for answers, but all I keep hitting on is
anchors and how to link to other pages.

If anyone can direct me to the commands to research or some
references/examples for what I'm trying to achieve, I would be extremely
grateful.

Thanks in advance.

EJ
 
J

John Hosking

Elliot said:
What I want to do is probably pretty basic, but as I've had no cause to look
into it previously, I'm currently a bit clueless.
I'm trying to find a way to link the text from test.txt into a table on my
front page, dynamically. So if I change the contents of test.txt then
refresh frontpage.htm, I can see the new text in the table.

To go one further, I would like to link certain blocks of text (ie: specific
contents of cells within a table) from a .htm file into my frontpage.htm
file in the same fashion.

I don't know how you can do this (further one). Any near-solutions I can
think of are more work than they're worth.
I have been trawling the net for answers, but all I keep hitting on is
anchors and how to link to other pages.

Fairly amazing. I pasted your post's title into my search engine and got
several likely candidates. But for quick-and-easy, I dug up the FAQ,
because this question and that answer come up here regularly.
If anyone can direct me to the commands to research or some
references/examples for what I'm trying to achieve, I would be extremely
grateful.

Does this help you?
http://www.htmlhelp.com/faq/html/design.html#include-file
 
S

Sherm Pendley

Elliot J said:
To go one further, I would like to link certain blocks of text (ie: specific
contents of cells within a table) from a .htm file into my frontpage.htm
file in the same fashion.

I have been trawling the net for answers, but all I keep hitting on is
anchors and how to link to other pages.

If anyone can direct me to the commands to research

The term for what you want is "server side includes", or "SSI". Here's a
tutorial - if you're not using Apache, you can skip the server config
section of it, but the part that describes how to write your HTML should
still be relevant, unless you're on a *very* strange server.

<http://httpd.apache.org/docs/2.2/howto/ssi.html>

sherm--
 
A

Amos E Wolfe

Elliot J said:
Hi all,

What I want to do is probably pretty basic, but as I've had no cause to
look into it previously, I'm currently a bit clueless.

Imagine I have a HTML front page (frontpage.htm), and a text file
(test.txt) on the same server.

I'm trying to find a way to link the text from test.txt into a table on my
front page, dynamically. So if I change the contents of test.txt then
refresh frontpage.htm, I can see the new text in the table.

assuming your server has php installed:

rename frontpage.htm to frontpage.php and include the line

<?php include("test.txt");?>
 
E

Elliot J

Sherm Pendley said:
The term for what you want is "server side includes", or "SSI". Here's a
tutorial - if you're not using Apache, you can skip the server config
section of it, but the part that describes how to write your HTML should
still be relevant, unless you're on a *very* strange server.

<http://httpd.apache.org/docs/2.2/howto/ssi.html>

sherm--

Hi all and thanks for the feedback.

I tried Amos' suggestion, which did what I wanted to a degree, but I ended
up using .csv files for my data and pulling it into web pages with
OBJECTS/Datasrc's.

My gratitude to all who responded.
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top