Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > include a text file into a webpage

Reply
Thread Tools

include a text file into a webpage

 
 
Hervé
Guest
Posts: n/a
 
      09-29-2003
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


 
Reply With Quote
 
 
 
 
SeeSchloss
Guest
Posts: n/a
 
      09-29-2003
> 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...


--
SeeSchloß - http://www.seeschloss.net

 
Reply With Quote
 
 
 
 
Hywel Jenkins
Guest
Posts: n/a
 
      09-29-2003
In article <3f789fb4$0$20150$(E-Mail Removed)>,
http://www.velocityreviews.com/forums/(E-Mail Removed) says...
> 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

--
Hywel I do not eat quiche
http://hyweljenkins.co.uk/
http://hyweljenkins.co.uk/mfaq.php
 
Reply With Quote
 
brucie
Guest
Posts: n/a
 
      09-29-2003
In post <3f789fb4$0$20150$(E-Mail Removed)>
Hervé said...

> i would like to know if it is possible to include a text file (all the text
> contained in the file) into a webpage.


http://allmyfaqs.com/faq.pl?Include_one_file_in_another

> If such function exist (whether in HTML, DHTML, javascript or why not PHP),


html requires client side support - unreliable
dhtml is just a marketing term for html+css+javascript
javascript requires client side support- unreliable

--
30/September/2003 08:12:01 am
 
Reply With Quote
 
Hervé
Guest
Posts: n/a
 
      09-30-2003
Thanks for your precious help!!

-- Hervé

"Hervé" <(E-Mail Removed)> a écrit dans le message de
news:3f789fb4$0$20150$(E-Mail Removed)...
> 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
>
>



 
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
/* #include <someyhing.h> */ => include it or do not include it?That is the question .... Andreas Bogenberger C Programming 3 02-22-2008 10:53 AM
ASP Include file error <!-- #include file="" --> naveeddil ASP .Net 0 01-04-2008 12:58 PM
include file in include file PTM HTML 1 11-12-2007 10:13 AM
#include "file" -vs- #include <file> Victor Bazarov C++ 4 03-06-2005 07:09 PM
Include html text in a webpage Gregor Traven HTML 11 10-21-2004 07:43 PM



Advertisments