SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    masquerading Nick's Avatar
    Join Date
    Jun 2003
    Location
    East Coast
    Posts
    2,215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry includes not working

    I am running this on my comp:

    PHP Code:
    <?
    include("/v4/includes/staff_header.php");
    ?>
    But it returns this:

    PHP Code:
    Warningmain(/v4/includes/staff_header.php): failed to open streamNo such file or directory in C:\webap\xampp\htdocs\v4\admin\pages.php on line 10

    Warning
    main(): Failed opening '/v4/includes/staff_header.php' for inclusion (include_path='.;C:\webap\xampp\php\pear\') in C:\webap\xampp\htdocs\v4\admin\pages.php on line 10 
    The funny thing is though that I have the same path for my style.css sheet and it works fine.

  2. #2
    SitePoint Evangelist
    Join Date
    Jul 2001
    Location
    Michigan, USA
    Posts
    414
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I believe that include uses the entire remote path, and not the web page. Either try adding the domain URL before the include or include the rest of the path (something along the lines of /home/username/public_html...though probably different in Windows)

  3. #3
    ********* Wizard silver trophy Cam's Avatar
    Join Date
    Aug 2002
    Location
    Burpengary, Australia
    Posts
    4,495
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Or you just just use $_SERVER['DOCUMENT_ROOT'] and build the path from that


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
  •