TeamPhotoshop
Reviews, updates and in depth guides to your favourite mobile games - AppGamer.com
Forum Home Latest Posts Search Help Subscribe

How do I include a text file in my html using PHP?

Page: 1 Reply
Sep 6th 2003#120841 Report
Member since: Mar 29th 2003
Posts: 1326
The question is so short I fit it all into the subject line. I have an .html file which I want to put my shout.txt file into. I have this so far but its not working:

[PHP]

include(shout.txt);

?>
[/PHP]

Do I need to add something in the head that says I'm going to use php? I'm sure its a basic error - somebody please help. Thanks.

tom
Reply with Quote Reply
Sep 6th 2003#120857 Report
Member since: Feb 14th 2003
Posts: 685
i believe u need to put the shout.txt in single quotes
like this

include ('shout.txt');

hope that helps

cheers
heathrowe
Reply with Quote Reply
Sep 7th 2003#120902 Report
Member since: Nov 26th 2001
Posts: 2586
Originally posted by trhaynes
I have an .html file which I want to put my shout.txt file into.


You can only use php includes on a .php page.
and yes you need quotes: include('somefile.txt');
Reply with Quote Reply
Sep 7th 2003#120928 Report
Member since: Jul 25th 2003
Posts: 489
I use [CODE]

?php require("path/file.html"); ?[/CODE] don't know if it's the


same?
Reply with Quote Reply
Sep 7th 2003#120940 Report
Member since: Mar 29th 2003
Posts: 1326
Marble - I can't use a PHP include in an HTML file? So if you check out my site (http://trhaynes.ionichost.com/gendes) and click view all shouts, that has to link to a .php file? How do I get the images, etc. to load on a .php page?

tom
Reply with Quote Reply
Sep 7th 2003#120946 Report
Member since: Nov 26th 2001
Posts: 2586
You can include an .html or a .txt file or a .php file, but in order for the include() function to work, the page that has the include function in it has to be a .php page, or else the server won't know to send it to the php daemen and use the function =)
Reply with Quote Reply
Page: 1 Back to top
Please login or register above to post in this forum