View Full Version : display textfile in html page
mucho
June 30th, 2005, 12:33 PM
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.
hl
June 30th, 2005, 01:17 PM
<?
include "http://www.somedomain.com/text.txt";
?>
mucho
July 1st, 2005, 02:50 AM
hLaLL: thanks, it aint working though :-(. Any other ideas?
Thx,
m.
Cybernoid
July 1st, 2005, 03:58 AM
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:
<!--#include file="textfile.txt" -->
and save your file with .shtml and check it _on a server_.
mucho
July 1st, 2005, 10:10 AM
@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.
simplistik
July 1st, 2005, 10:52 AM
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 include("http://www.nsomedomain.com/count.txt"); ?>
bwh2
July 1st, 2005, 11:53 AM
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.
mucho
July 1st, 2005, 12:04 PM
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!
simplistik
July 1st, 2005, 12:13 PM
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 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.
mucho
July 1st, 2005, 12:21 PM
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.
simplistik
July 1st, 2005, 12:49 PM
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.
mucho
July 1st, 2005, 12:57 PM
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.
simplistik
July 1st, 2005, 01:35 PM
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 include("http://www.beyondthepixel.com/text.txt"); ?>
<?php echo("The stupid text file should be appearing here"); ?>
bwh2
July 1st, 2005, 02:55 PM
you are trying this on a server that supports php, right? and you're using a .php filename, right?
mucho
July 1st, 2005, 05:08 PM
@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.
Ankou
July 1st, 2005, 07:17 PM
I'd say check the version of PHP as well as if the php.ini file has allow_url_fopen set to "1". Also take a peek at:
http://us3.php.net/manual/en/ref.filesystem.php#ini.allow-url-fopen
mucho
July 4th, 2005, 05:01 AM
@ankou: allow_url_fopen is allowed, other links work perfectly.
I`m working on this and keep you guys posted once I `d figure it out.
thx for all the help,
m.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.