Display a text file within a webpage

Posted on 2011-05-10
Last Modified: 2012-05-11
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  ( 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
Question by:teedo757
    LVL 16

    Expert Comment

    include 'rooms/schedule.txt';
    LVL 30

    Expert Comment

    by:Marco Gasi

    With php you can use include statement (

    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! :-)

    LVL 30

    Expert Comment

    by:Marco Gasi
    oops, forgot to refresh...o
    LVL 20

    Expert Comment

    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="" border="0" >

    Set the width, height and border for the text box as you wish.
    LVL 81

    Expert Comment

    LVL 3

    Author Comment

    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.
    LVL 27

    Accepted Solution

    LVL 12

    Assisted Solution

    by:Mohamed Abowarda

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
    Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now