#1
  1. No Profile Picture
    Indie Poser Punk
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Location
    Wayne, PA
    Posts
    216
    Rep Power
    15
    I'm trying to use include files with PHP3 in a regular document. It works fine with any include files within the the directory where the main document lives, but when I look for files outside the directory, it cant find them. Same thing happens with "require()"

    Sample that works:

    <?php
    require("stuff.inc");
    ?>

    Sample that doesn't:

    <?php
    require("/includes/stuff.inc");
    ?>

    Thanks.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Washington, USA
    Posts
    52
    Rep Power
    15
    you need to put the FULL path to files outside the directory the script is in, much the same you need the full path to images in different directories when using the <IMG SRC> tag in html. Try

    require("/path/to/stuff.php");
    include("/path/to/stuff.php");



    ------------------
    <UL TYPE=SQUARE>
    <LI> TD Scripts
    <LI> Script School
    <LI>php-scripts
    </UL>
  4. #3
  5. No Profile Picture
    Indie Poser Punk
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Location
    Wayne, PA
    Posts
    216
    Rep Power
    15
    That's what I tried, but it isn't working. In fact, I tried to really follow the direct path by using the http://www.blashblah.com/includes/stuff.php and it still doesn't work. D'oh! Thanks!



    [This message has been edited by BicyclePunk (edited August 22, 2000).]
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Washington, USA
    Posts
    52
    Rep Power
    15
    No, the full SERVER path, not the url path

    require("/home/user/www/files/stuff.php");


  8. #5
  9. No Profile Picture
    Indie Poser Punk
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Location
    Wayne, PA
    Posts
    216
    Rep Power
    15
    That's it! Thanks!!

Similar Threads

  1. php script won't work inside "cgi-local" directory
    By Volitics in forum PHP Development
    Replies: 5
    Last Post: April 26th, 2004, 10:50 PM
  2. Replies: 1
    Last Post: February 6th, 2004, 08:09 PM
  3. Backing up directory
    By purplegrum in forum Linux Help
    Replies: 5
    Last Post: December 18th, 2003, 03:57 AM
  4. include path problems - after uploading to host
    By alaw in forum PHP Development
    Replies: 2
    Last Post: December 9th, 2003, 05:11 PM
  5. #include <wx/...>
    By kes103 in forum C Programming
    Replies: 1
    Last Post: December 8th, 2003, 12:34 PM

IMN logo majestic logo threadwatch logo seochat tools logo