471,306 Members | 848 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,306 software developers and data experts.

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
Jul 17 '05 #1
2 1729
John wrote:
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


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

- Dan
http://www.dantripp.com/
Jul 17 '05 #2
include ('header.inc');

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

Alain
"John" <qu***@quack.com> schreef in bericht
news:id********************************@4ax.com...
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

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Gregory | last post: by
7 posts views Thread by p | last post: by
3 posts views Thread by Manuel | last post: by
1 post views Thread by developer | last post: by
reply views Thread by mchuc7719 | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.