Skip to main content
Known Participant
January 11, 2010
Answered

Insert function in php not working?

  • January 11, 2010
  • 1 reply
  • 778 views

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.

This topic has been closed for replies.
Correct answer StephanLiebig

The include-function expects a string, so try include 'Header.php' or include('Header.php')

1 reply

Participating Frequently
January 11, 2010

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?

Known Participant
January 11, 2010

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.

StephanLiebigCorrect answer
Participating Frequently
January 12, 2010

The include-function expects a string, so try include 'Header.php' or include('Header.php')