Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Insert function in php not working?

Participant ,
Jan 11, 2010 Jan 11, 2010

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.

TOPICS
Server side applications

Views

675
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , Jan 12, 2010 Jan 12, 2010

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

Votes

Translate
LEGEND ,
Jan 11, 2010 Jan 11, 2010

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?

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jan 11, 2010 Jan 11, 2010

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.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 12, 2010 Jan 12, 2010

Copy link to clipboard

Copied

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 12, 2010 Jan 12, 2010

Copy link to clipboard

Copied

LATEST

and the semikolon 😉


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines