Error with Php

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John

    Error with Php

    Hi.

    I'm new to the world of Php. I am going to be converting my website
    over the next year to be a Php site. Hopefully this is going to
    coincide with myself learning the basics of Php.

    I intend to get hold of a copy of Dreamweaver soon, and also get a
    book on it as well.

    Anyway, my first attempt at Php has given me an error. What I am
    trying to do is to put all the header info for my webpages into an
    include file, so I can just bring the same include file up for the
    same header info for each page.

    My first page starts:

    <?php
    include ("/header.inc");
    ?>

    When viewing the page though I get the following error:

    Warning: main(.inc): failed to open stream: No such file or directory
    in /home/public_html/index.php on line 3

    Warning: main(): Failed opening '.inc' for inclusion
    (include_path=' .:/usr/lib/php:/usr/local/lib/php') in
    /home/public_html/index.php on line 3

    You don't have any idea what this error is do you?

    Thanks

    John


  • Dan Tripp

    #2
    Re: Error with Php

    John wrote:
    [color=blue]
    > Hi.
    >
    > I'm new to the world of Php. I am going to be converting my website
    > over the next year to be a Php site. Hopefully this is going to
    > coincide with myself learning the basics of Php.
    >
    > I intend to get hold of a copy of Dreamweaver soon, and also get a
    > book on it as well.
    >
    > Anyway, my first attempt at Php has given me an error. What I am
    > trying to do is to put all the header info for my webpages into an
    > include file, so I can just bring the same include file up for the
    > same header info for each page.
    >
    > My first page starts:
    >
    > <?php
    > include ("/header.inc");
    > ?>
    >
    > When viewing the page though I get the following error:
    >
    > Warning: main(.inc): failed to open stream: No such file or directory
    > in /home/public_html/index.php on line 3
    >
    > Warning: main(): Failed opening '.inc' for inclusion
    > (include_path=' .:/usr/lib/php:/usr/local/lib/php') in
    > /home/public_html/index.php on line 3
    >
    > You don't have any idea what this error is do you?
    >
    > Thanks
    >
    > John
    >
    >[/color]

    Are you sure you don't mean:
    include("./header.inc");
    Or simply:
    include("header .inc");

    - Dan

    Comment

    • Alain Dhaene

      #3
      Re: Error with Php

      include ('header.inc');

      or when header is in an upper map
      include ('../header.inc')

      Alain
      "John" <quack@quack.co m> schreef in bericht
      news:ide6105q4t gitr2pktuq8v358 vao9j352c@4ax.c om...[color=blue]
      > Hi.
      >
      > I'm new to the world of Php. I am going to be converting my website
      > over the next year to be a Php site. Hopefully this is going to
      > coincide with myself learning the basics of Php.
      >
      > I intend to get hold of a copy of Dreamweaver soon, and also get a
      > book on it as well.
      >
      > Anyway, my first attempt at Php has given me an error. What I am
      > trying to do is to put all the header info for my webpages into an
      > include file, so I can just bring the same include file up for the
      > same header info for each page.
      >
      > My first page starts:
      >
      > <?php
      > include ("/header.inc");
      > ?>
      >
      > When viewing the page though I get the following error:
      >
      > Warning: main(.inc): failed to open stream: No such file or directory
      > in /home/public_html/index.php on line 3
      >
      > Warning: main(): Failed opening '.inc' for inclusion
      > (include_path=' .:/usr/lib/php:/usr/local/lib/php') in
      > /home/public_html/index.php on line 3
      >
      > You don't have any idea what this error is do you?
      >
      > Thanks
      >
      > John
      >
      >[/color]


      Comment

      Working...