I know that what I am about to ask is probably extremely simple so please don't be too scathing in your replies... I am an absolute beginner!
I am building a website using Dreamweaver and PHP, I am currently "slicing" my html code into sections and am saving the sections as "header.php" for example.
So this is where I am stuck, I then in the index.php file am trying to call the header `
Which is not returning any errors in terms of syntax however I then sync all my files onto my web hosting server and the following error gets returned.
Warning: include(includes/home/public_html/header.php): failed to open stream: No such file or directory in D:\Sites\XXXXXXXXXX.com\public_html\index.php on line 20 Warning: include(includes/home/public_html/header.php): failed to open stream: No such file or directory in D:\Sites\XXXXXXXXXX.com\public_html\index.php on line 20 Warning: include(): Failed opening 'includes/home/public_html/header.php' for inclusion (include_path='.;C:\php\pear') in D:\Sites\XXXXXXXXXX.com\public_html\index.php on line 20
I have tried to amend the code to reflect what the error is showing me, or at least I thought I had by writing.
<?php include_path='.;C:\php\pear('includes/header.php'); ?>
However Dreamweaver is then throwing up that there is a syntax error.
If you need any further information please ask, and thank you in advance for your help, I am trying to learn so forgive my ignorance.
Best wishes
Richard
Update----
So I have now managed to get rid of the errors and am still stuck though, I have the index.php and the header.php file in the same location home/public_html/
in my index.php file I have the following code to return the header.php file.
<body>
<div id="wrapper">
<?php ('includes/home/public_html/header.php'); ?>
now as I mentioned the error has gone but no header is being returned.
Within the header.php file I have the following code,
<html>
<body>
<div class="header">
<div id="header">
<h2>Welcome</h2>
</div>
</div> <!-- end #header -->
Am I doing something really obviously wrong?
Try and use the built include function.
<?php
include("includes/header.php");
?>
is your includes folder in the same directory as the index.php? there should be no need to change the include path.