Welcome to Discuss Everything Forums...

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.


 

Tags for this Thread

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    That guy's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Jun 2009
    Posts
    228
    Downloads
    0
    Uploads
    0

    Is there an html code to use the code from another file?

    Say I have a really long piece of html code saved on a file that needs to appear on several other html files at the same time. The long html code is dynamic (it will be updated regularly), and I don't want to clutter up every file it's used on with the really long code. Is there an html command I can take to use the code from one file and add it to any file with that command?
    Big Gryph: I tried that command, but it didn't work.
    brisray: The iframe functions isn't working on my computer. Do I have to be on a PC instead of my laptop?

  2. #2
    Tedy's Avatar
    Newbie - NLP

    Status
    Offline
    Join Date
    Apr 2012
    Age
    29
    Posts
    9
    Downloads
    0
    Uploads
    0
    You can use the 'include' function, but you have to change the extension for every page that will use that file.

    For example, we have a page called 'header.php', and another one called 'body.php' . If you want to include the header file in second one, open body.php and add this code:

    <?php include ('header.php') ?>


    Now you can do the same thing with other files ... Note that the .php extension doesn't affect your pages!

 

 

Quick Reply Quick Reply

Click here to log in


What is the number after 87?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 02-23-2011, 05:47 AM
  2. Replies: 0
    Last Post: 11-03-2009, 05:50 PM
  3. Replies: 0
    Last Post: 08-31-2009, 02:36 PM
  4. Replies: 1
    Last Post: 06-08-2009, 11:50 PM
  5. Replies: 0
    Last Post: 12-03-2008, 05:00 PM

Bookmarks

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •