HI I am using XAMPP on Windows XP. I am having problems running the script below.
I understand it is to do with the location of files, but I am struggling to resolve.
<?php
// include the layout file
include $_SERVER['DOCUMENT_ROOT'].
'/layout.php';
// Use the myheader function from layout.php
myheader("Welcome to My Website!");
// Include the welcome html page.
include $_SERVER['DOCUMENT_ROOT'].
'/html/index_page.html';
// Include News Index File
include $_SERVER['DOCUMENT_ROOT'].
'/includes/news_index.php';
// Use the footer function from layout.php
footer();
?>
The error output is:
Warning: include(C:/xampp/htdocs/layout.php) [function.include]: failed to open stream: No such file or directory in C:\xampp\htdocs\myphp\public_html\index.php on line 5
Warning: include() [function.include]: Failed opening 'C:/xampp/htdocs/layout.php' for inclusion (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\myphp\public_html\index.php on line 5
Fatal error: Call to undefined function myheader() in C:\xampp\htdocs\myphp\public_html\index.php on line 8