SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Php Help

  1. #1
    SitePoint Member
    Join Date
    Sep 2003
    Location
    Shelton, CT
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Php Help

    I am trying to use the include statement for a menu on every page but I keep getting the following:
    Warning: main(./include/header/test.php): failed to open stream: No such file or directory in C:\Inetpub\wwwroot\IPCNET\new\main.php on line 10

    Warning: main(): Failed opening './include/header/test.php' for inclusion (include_path='.;c:\Inetpup\wwwroot\IPCNET\include\') in C:\Inetpub\wwwroot\IPCNET\new\main.php on line 10

    test.php is in the directory defined in php.ini.

    Here is the code I am using for the include:
    <?PHP
    include("test.php");
    ?>

    What is going wrong???

  2. #2
    SitePoint Addict devil cat's Avatar
    Join Date
    Apr 2003
    Location
    Reno
    Posts
    344
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have had problems using include() with files named .php. Try changing the extention.

  3. #3
    SitePoint Evangelist
    Join Date
    Nov 2001
    Location
    UK
    Posts
    553
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To the best of my knowledge, include() isn't picky about file types. Try moving test.php into the same directory as the file including it. The error you are getting suggests that PHP can't find the file to be included.
    Regards, Ant.


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
  •