Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Inserting the contents of a txt file onto a html file  (Read 3144 times)

0 Members and 1 Guest are viewing this topic.

steven32collins

    Topic Starter


    Intermediate
    • Experience: Beginner
    • OS: Windows XP
    Inserting the contents of a txt file onto a html file
    « on: March 25, 2010, 02:30:37 PM »
    Hi how would i make it so the contents of a file called Noticebar.txt and inside the file is this peice of html

    <tr>
         <th>hi</th>


    How would i insert that on my html index page without copy and paste. (so it can be updated without looking threw the index file)
    Everything should be made as simple as possible, but not simpler.
    --Albert Einstein--

    kpac

    • Web moderator
    • Moderator


    • Hacker

    • kpac®
    • Thanked: 184
      • Yes
      • Yes
      • Yes
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 7
    Re: Inserting the contents of a txt file onto a html file
    « Reply #1 on: March 25, 2010, 02:53:28 PM »
    Add this to your page exactly where you want it to appear:

    Code: [Select]
    <?php include(dirname(__FILE__) . "/file.txt"); ?>