Submit Your Article Forum Rules

Results 1 to 3 of 3

Thread: how i include a table in multiple sites?

  1. #1
    Junior Member
    Join Date
    Apr 2011
    Posts
    2

    how i include a table in multiple sites?

    Hello

    I have multiple of websites. I want to include an html table in every footer of those sites. The table code is in a file located on another site.
    All sites are php.

    I want this so that I can modify the table from one file instead of having to modify it mutiple times.

    Is that possible ? And how can I do it ?

    Give any best idea which is helpful for me.


    Thank you.

    Regards

  2. #2
    Junior Member
    Join Date
    Apr 2011
    Posts
    2
    I have put the table code in a file datalinks.inc

    Then I used the following function:

    <?php include("datalinks.inc"); ?>

    in every site's footer.

    when i do that its not work and i did not know what to do.

    what would i do now?

    help me

  3. #3
    Senior Member texxs's Avatar
    Join Date
    Jul 2005
    Posts
    528
    I'd go with Sooraj's method (using a php include). The current method is to use "require instead of include here's detailed instructions in case you need them:

    Make the table, copy the html for the table and it's content alone into a plain text file and save it as TheTable.inc (or whatever) put it in a directory on one of your websites like myMainWebSite.com/includes/datalinks.inc or whatever. Then place this code on any web page (as long as it ends with a .php file extension and it is on a server that will run PHP), on any website where you want that table to appear.
    PHP Code:
    <?php
    require_once("http://myMainWebSite.com/includes/datalinks.inc");
    ?>
    If you do this correctly and it doesn't work there is there is one of two problems in play:
    1-Your server doesn't run PHP
    2-your server allows PHP but doesn't allow "including" files. contact them and they'll give you simple instruction about putting some text in a file and placing it on your server to give yourself permission.

    Welcome to the wonderful world of PHP, that was easy wasn't it?

Posting Permissions

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