The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.


Page 1 of 2 12 LastLast
Results 1 to 15 of 17

Thread: display textfile in html page

  1. #1

    display textfile in html page

    Hi all,

    I have a text file (lets use http://www.somedomain.com/text.txt) and I would like to display this text file in a HTML page. I know this must be extremly simpl y. I`ve tried <a scr= url("http://naomieharris.akdmx.com/count.txt")> </a> and tried it with php (although php is supported, it would be accepted). My guess is the easier the HTML the more likely is the probability that it`ll be displayd.

    Any ideas? thanks in advance for your help,
    m.

  2. #2
    <?
    include "http://www.somedomain.com/text.txt";
    ?>

  3. #3
    hLaLL: thanks, it aint working though :-(. Any other ideas?

    Thx,
    m.
    --
    ...do you remember where it was at?

  4. #4
    PHP Code:

    include("textfile.txt"); 
    That _will_ work, just change the name of the file and rename the "HTML"-file to .PHP before you run it _on a server_.

    For HTML-include, use SSI:
    Code:
    <!--#include file="textfile.txt" -->
    and save your file with .shtml and check it _on a server_.

  5. #5
    @Cybernoid: thanks, the filename is named .php but it still would not work. I can not use the SSI idea, since I`m running numerous php scripts already.

    <table cellpadding="0 width="100%" cellspacing="0" border="0">
    <tr>
    <td align="left" valign="top"><nobr>
    <a href="http://somedomain.com/count.txt">count</a> |
    <? include("http://nsomedomain.com/count.txt"); ?>
    </nobr></td>
    </tr>
    </table>

    RRRRRR - thoughts, comments, jokes?

    thx,
    m.

  6. #6
    it should work... the only that I can see that you may have to do is put a www infront of your domain... or add php after the first ?... but that shouldn't make a difference.

    PHP Code:
    <?php include("http://www.nsomedomain.com/count.txt"); ?>
    Let us live so that when we come to die even the undertaker will be sorry. - Mark Twain
    Don't PM me your CSS, xHTML, JS or PHP questions. I will not reply to ANY IE6 questions.

  7. #7
    simp's code should work. what you need to do is add the <?php to begin the php. you don't need the full domain though.

  8. #8
    simplistik,
    I tried your code...darn, still not working. First I had the .txt under a subdomain, but I can call on ot via www. as well. It just won`t show!
    --
    ...do you remember where it was at?

  9. #9
    Hmm... strange... well if you want you can compress the files up and send them my way w/ the proper links and I'll take a look at it for you... just seems strange. Something trixy has to be going on in the rest of your page coding that's interfereing w/ the code... just to check replace your php line w/ this...
    PHP Code:
    <?php echo('The stupid text file should be appearing here'); ?>
    It should echo that statement after your link... if it's doesn't then there is something odd goin on elsewhere.
    Let us live so that when we come to die even the undertaker will be sorry. - Mark Twain
    Don't PM me your CSS, xHTML, JS or PHP questions. I will not reply to ANY IE6 questions.

  10. #10
    hey simplsitik,
    thanks for the offer.. I tried the echo function. not working - so I guess the problem is somewhere else. To give you little more input. This site is sort of a project management system where one can add projects, add user, assign tasks AND there is individually customizable start page with several moduels (babelfish, google search, notes, etc.) These can be customized by adding HTML code to them. Since the whole thing is PHP I though this must be working as well... it didn`t, also, single quotes won`t won`t be accepted at all. I won`t be able to give you much other than the already renderd PHP code, when viewing the frames source code.
    hmmmm..... ahh how do we get this thingy to work...?
    m.
    --
    ...do you remember where it was at?

  11. #11
    Yea you'll have to go through your coding... what it sounds like from here is that you have an open tag somewhere or an extra < or > or ; where it shouldn't be. I usually scan through manually... but I believe Dreamweaver or something is able to run a code check to see if there are errors such as open tags and things of that nature.
    Let us live so that when we come to die even the undertaker will be sorry. - Mark Twain
    Don't PM me your CSS, xHTML, JS or PHP questions. I will not reply to ANY IE6 questions.

  12. #12
    within that customizable module, this:


    <table cellpadding="0 width="100%" cellspacing="0" border="0">
    <tr>
    <td align="left" valign="top"><nobr>
    <?php include("http://www.domain.com/count.txt"); ?>
    <?php echo("The stupid text file should be appearing here"); ?>
    </nobr></td>
    </tr>
    </table>

    is the only code that I have in it. The link works perfectly...that`s why I`m so frustrated... bahhh.
    cheers,
    m.
    --
    ...do you remember where it was at?

  13. #13
    Hmmm... aside from the nobr tag i've duplicated your code just to check, and put it on my server. http://www.beyondthepixel.com/txt.php it seems to work just fine my two php lines are:

    PHP Code:
    <?php include("http://www.beyondthepixel.com/text.txt"); ?>
    <?php 
    echo("The stupid text file should be appearing here"); ?>
    Let us live so that when we come to die even the undertaker will be sorry. - Mark Twain
    Don't PM me your CSS, xHTML, JS or PHP questions. I will not reply to ANY IE6 questions.

  14. #14
    you are trying this on a server that supports php, right? and you're using a .php filename, right?

  15. #15
    @simplistik: yeah... I guess that it has to do something with, how the html code is being processed from within the customized modules....
    @bwh2: yes... the "application" site that I`m running is completely php based...
    ARGHHHHHH .... plus I just went to see WotW .... now the frustration is compelte ;-)
    thanks for the support guys,

    m.
    --
    ...do you remember where it was at?

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012