Include shows on my computer but not when uploaded

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jauiek
    New Member
    • Feb 2007
    • 3

    Include shows on my computer but not when uploaded

    Hello, I have been trying to learn PHP and have been spending all day trying to solve this "simple" problem. I am using Mac OS X 10.4. I am trying to create a site for myself that gets me out of always having to update main navigation links on every page by learning how to use a server side include.

    I created a index page with the following include:

    [PHP] <?php include("includ es/header.php"); ?> [/PHP]

    The header is just a simple nav bar with html text links. This works fine the header is displayed properly on top of the index page.

    Within this header I am trying to have another include in a table cell for another set of links. This is what is not working. I have tried this code in a table cell as follows:

    [PHP] <?php include("includ es/mainLinks.php") ; ?> [/PHP]

    so basically I have an index page that brings in a header with links and a header that brings in another set of links. So one index file and two includes.

    Everything works fine on my computer but when uploaded I get this error:

    Warning: main() [function.main]: open_basedir restriction in effect. File(/usr/share/pear//mainLinks.php) is not within the allowed path(s):

    Any help would be appreciated

    Thanks
  • jauiek
    New Member
    • Feb 2007
    • 3

    #2
    I have been trying to figure this out more and have been getting this error:

    Call to undefined function include_path()

    thanks

    Comment

    • cassbiz
      New Member
      • Oct 2006
      • 202

      #3
      Try re-writing your include statement

      Code:
      <?php include "includes/mainLinks.php"; ?>
      Good Luck

      Comment

      • d3vkit
        New Member
        • Nov 2006
        • 34

        #4
        Originally posted by cassbiz
        Try re-writing your include statement

        Code:
        <?php include "includes/mainLinks.php"; ?>
        Good Luck
        Is there any difference? All I see is the parenthesis removed. Is that different in how it includes?

        Comment

        • Atli
          Recognized Expert Expert
          • Nov 2006
          • 5062

          #5
          Hi

          Try changing the line like this

          [php]
          // From
          <?php include("includ es/mainLinks.php") ; ?>
          // To
          <?php include("./includes/mainLinks.php") ; ?>
          [/php]

          It wouldn't matter on Windows, but I dont know about Linux or Mac.

          Comment

          • jauiek
            New Member
            • Feb 2007
            • 3

            #6
            Thanks everyone and sorry for the super late reply... got it!!

            Comment

            Working...