does following this work on linux server?
<? require 'foldername/header.php' ?>
the above code is present in home.php
. home.php
is in folder foldername
.
does following this work on linux server?
<? require 'foldername/header.php' ?>
the above code is present in home.php
. home.php
is in folder foldername
.
No. You want:
require 'header.php';
because you're already in foldername.
It depends on how your php.ini is set up but the default behaviour is to look in the current directory and the include directory or directories (if any) so "foldername/header.php" is relative to the path of the home.php script.
echo get_include_path() . ';' . $_SERVER['DOCUMENT_ROOT'];
This will show you the directories that require() will be relative to.
It will probably start with ".;" with the DOCUMENT_ROOT will describe literally.