Copy link to clipboard
Copied
I created a home page and I have a header.php page. In the homepage I wanted to include Header.php so I did this
<?php
include(Header.php);
?>
When I browse to my page I get the following error which you can also see in the image I have provided.
Warning: include(Headerphp) [function.include]; failed to open stream: No such file or directory in C:\xampp\htdocs\carnivorousflamingo.com\home.php on line 3
Warning: include() [function.include]; Failed opening 'Headerphp' for inclusion (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\carnivorousflamingo.com\Home.php on line 3
I have tried to code these ways to:
<?php
include(../Header.php);
?>
<?php
include(/Header.php);
?>
but neither of them worked either. I am using xampp, phpmyadmin, hosting with Apache.
my file name is correct and my extension is .php
but I still get the same error message.
The browser I was using was google chrome.
The include-function expects a string, so try include 'Header.php' or include('Header.php')
Copy link to clipboard
Copied
You failed to mention where Header.php is located. Also, at one point you refer to it as header.php and another as Header.php. Which is it?
Copy link to clipboard
Copied
It is Header.php
and it is located in the site folder so i do not have to go into any folders inside of my site folder to see it.
Copy link to clipboard
Copied
The include-function expects a string, so try include 'Header.php' or include('Header.php')
Copy link to clipboard
Copied
and the semikolon 😉