It might not have stated clearly what was the main problem in this post. My english is not a first language and it's sometimes a reason i cannot precisely express my thoughts.
My website will consist of 3 parts: header, footer and main content in the middle. I don't want to repeat in every script exactly those parts which are in header and footer. On my localhost I have used PHP function include(), which is supposed to add header and footer, in the similar way as below:
PHP Code:
<?php
include($_SERVER['DOCUMENT_ROOT'].'/header.php');
?>
<p>something here which contains main content</p>
<?php
include($_SERVER['DOCUMENT_ROOT'].'/footer.php');
?>
The script works here at my localhost server. Once I have uploaded the example script with both functions include(), the server has showed information that in the line where this function is placed, there's a syntax error. As I was very surprised why, I have checked if this function exists at all. I have tied another script:
PHP Code:
if(function_exists('include'));
and it's returned false.
My question is what I am doing wrong. Why I cannot include my header and footer. IS this due to limits on free hosting server?
Thanks for any suggestions.