include a text file into a webpage

Discussion in 'HTML' started by Hervé, Sep 29, 2003.

  1. Hervé

    Hervé Guest

    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
    Hervé, Sep 29, 2003
    #1
    1. Advertising

  2. Hervé

    SeeSchloss Guest

    > 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
    SeeSchloss, Sep 29, 2003
    #2
    1. Advertising

  3. In article <3f789fb4$0$20150$>,
    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
    Hywel Jenkins, Sep 29, 2003
    #3
  4. Hervé

    brucie Guest

    In post <3f789fb4$0$20150$>
    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
    brucie, Sep 29, 2003
    #4
  5. Hervé

    Hervé Guest

    Thanks for your precious help!!

    -- Hervé

    "Hervé" <> a écrit dans le message de
    news:3f789fb4$0$20150$...
    > 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
    >
    >
    Hervé, Sep 30, 2003
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gregor Traven

    Include html text in a webpage

    Gregor Traven, Oct 20, 2004, in forum: HTML
    Replies:
    11
    Views:
    11,080
    Jeffrey Silverman
    Oct 21, 2004
  2. Victor Bazarov

    #include "file" -vs- #include <file>

    Victor Bazarov, Mar 5, 2005, in forum: C++
    Replies:
    4
    Views:
    523
    Exits Funnel
    Mar 6, 2005
  3. PTM
    Replies:
    1
    Views:
    317
    Andy Dingley
    Nov 12, 2007
  4. naveeddil
    Replies:
    0
    Views:
    551
    naveeddil
    Jan 4, 2008
  5. Andreas Bogenberger
    Replies:
    3
    Views:
    882
    Andreas Bogenberger
    Feb 22, 2008
Loading...

Share This Page