include a text file into a webpage

H

Hervé

Hi,
i would like to know if it is possible to include a text file (all the text
contained in the file) into a webpage.
i explain: i already got text files, and now have HTML pages, but don't want
to copy texts for weight place .

If such function exist (whether in HTML, DHTML, javascript or why not PHP),
could you help me plz?

Thanks a lot

Herve
 
S

SeeSchloss

Hi,
i would like to know if it is possible to include a text file
(all the text contained in the file) into a webpage.
i explain: i already got text files, and now have HTML pages, but
don't want to copy texts for weight place .

If such function exist (whether in HTML, DHTML, javascript or
why not PHP), could you help me plz?

In PHP, you can do :

include ("texte.txt");

If it isn't preformated and you want to add a <br /> at
every end of line, you can try :

print (nl2br (file_get_contents ("texte.txt")));

instead, but your PHP version needs to be at least 4.3.0.
There is another way to do it with older version but it is
a bit more complicated, if you want to know it, just ask
:)

There is probably a way to do it in javascript, but I
wouldn't recommend it...
 
H

Hywel Jenkins

Hi,
i would like to know if it is possible to include a text file (all the text
contained in the file) into a webpage.
i explain: i already got text files, and now have HTML pages, but don't want
to copy texts for weight place .

If such function exist (whether in HTML, DHTML, javascript or why not PHP),
could you help me plz?

A simple google on this group, or even a general search for "include a
text file" would have given you these:
http://tinyurl.com/p3m2
http://www.bignosebird.com/ssi.shtml
 

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,755
Messages
2,569,539
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top