Display a text file within a webpage

I am not sure the best way to do this but I am trying to overlay/import a text file in its entirety onto a website. The text file resides on the web  (example.site/rooms/schedule.txt). It is a simple text file, here is an example of what it looks like.

room 215
Education Reform
8:00am - 10:00am

room 218
Website stuff
9:30am - 11:00am



So all I want to do is have a simple header on the page and then list the text file and then have a footer. Is there an easy way to do this? Thanks
LVL 3
teedo757Asked:
Who is Participating?
 
Lukasz ChmielewskiCommented:
0
 
JF0Commented:
<?php
include 'rooms/schedule.txt';
?>
0
 
Marco GasiFreelancerCommented:
Yes.

With php you can use include statement (http://www.php.net/manual/en/function.include.php)

You can use a normal html page, but give it a php extension, so mypage.html becomes mypage.php

Write you normal html code with doctype, head tag, body, header, footer and so on.

Then, exactly where you want your text file appear write this

<?php inclòude('rooms/schedule.txt'); ?>

You only have to adjust the file path accordingly your page location and all text will magiùcally apeear on your web page! :-)

Cheers
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Marco GasiFreelancerCommented:
oops, forgot to refresh...o
0
 
carlmdCommented:
Just make a simple page, and at the point where you want the text inserted do....

<object width="625" height="300" type="text/plain" data="http://www.mydomain.com/message.txt" border="0" >
</object>

Set the width, height and border for the text box as you wish.
0
 
leakim971PluritechnicianCommented:
0
 
teedo757Author Commented:
I dont think I will be able to use the include command since the source URL is on an external server. I will try the object command and see if that works.
0
 
Mohamed AbowardaSoftware EngineerCommented:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.