Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: How to include from one file?

  1. #1

    How to include from one file?

    Hi,
    Is it possible to do the following.. So from one site to another or to file on server...

    Like this:
    PHP Code:
    <?php include "http://site.com/file.php"?>
    Or:
    PHP Code:
    <?php include "public_html/file.php"?>
    So that I only need to update one file instead of 3 zillion?


    Greetz
    |Nico Lawsons

  2. #2
    Yes, for example I use:

    Code:
    <? include("/www/dynamic/title.txt"); ?>
    which - if I want to add some kind of huge thing to my title tag in a month or something it's no problem.

  3. #3
    Quote Originally Posted by Rizy View Post
    Yes, for example I use:

    Code:
    <? include("/www/dynamic/title.txt"); ?>
    which - if I want to add some kind of huge thing to my title tag in a month or something it's no problem.
    Great, so <? include("/public_html/topsites.php"); ?> should work?

    Greetz
    |Nico Lawsons

  4. #4
    Quote Originally Posted by Aquarezz View Post
    Great, so <? include("/public_html/topsites.php"); ?> should work?

    Greetz
    Probably going to need to do the full dir, /home/user/public_html/topsites.php - as how you said would make it more dependent where your including from since it's not the full dir.

  5. #5
    Alright, thanks a lot!

    Greetz
    |Nico Lawsons

  6. #6
    If you're using add-on domains... You can use the following:
    PHP Code:
    <? include("../topsites.php"); ?>
    The ".." means to go up one directory.

  7. Charles,
    Yes that is correct and to go one step further if you are pulling everything from another Add on domain.

    <?php
    include ('/home/YOURMAINDIR/public_html/YOURDOMAIN.COM/includes/fb.php');

    Where YourDomain.com is going to be the add on you are pulling it from..


    Quote Originally Posted by Charles View Post
    If you're using add-on domains... You can use the following:
    PHP Code:
    <? include("../topsites.php"); ?>
    The ".." means to go up one directory.

  8. #8
    Quote Originally Posted by coows View Post
    /home/YOURMAINDIR/public_html/
    You shouldn't actually need that part. You would only need to include the full path, if you were to have a '/' before the add-on domain folder.
    PHP Code:
    <?php include("YOURDOMAIN.COM/includes/fb.php"); ?>
    That should work equally well.

  9. I gotcha.......
    Quote Originally Posted by Charles View Post
    You shouldn't actually need that part. You would only need to include the full path, if you were to have a '/' before the add-on domain folder.
    PHP Code:
    <?php include("YOURDOMAIN.COM/includes/fb.php"); ?>
    That should work equally well.

  10. If your host has allow_url_open and allow_url_include enabled in php.ini, you can even do this:
    Code:
    include 'http://www.example.com/file.php';
    Unfortunately, those settings are somewhat unpopular due to the number of Remote File Inclusion exploits.
    Submit Your Webmaster Related Sites to the NB Directory
    I swear, by my life and my love of it, that I will never live for the sake of another man, nor ask another man to live for mine.

Page 1 of 2 12 LastLast

Similar Threads

  1. How i include a table in multiple sites?
    By sooraj in forum Web Design
    Replies: 5
    Last Post: 7 November, 2012, 09:15 AM
  2. [WTS] PR1 File Mirror Site - Upload to 15 File Hosts
    By ChaoscripT in forum Sites
    Replies: 0
    Last Post: 26 September, 2010, 10:53 AM
  3. Replies: 3
    Last Post: 3 May, 2010, 11:57 AM
  4. Favicon.ico file
    By Micks86 in forum Promoting
    Replies: 3
    Last Post: 8 June, 2009, 07:56 AM

Tags for this Thread

Bookmarks

Posting Permissions

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