PHP and Includes not working

Is there anything special to allow server side includes in PHP to work? We upgraded PHP and now the headers and footer includes are no longer working ... Any changes required on the server side? Any help will be appreciated.



PHP
Answer Share

2 Answers

PhilMeyer answered 16 years ago
PhilMeyer answered 16 years ago

Hi,

Try using this: include($_SERVER['DOCUMENT_ROOT'] . '/directory/myfile.php');

$_SERVER['DOCUMENT_ROOT'] will give you /home/USERNAME/public_html. If you're using an add-on domain, that directory will be included at the end.

So your include will look like /home/USERNAME/public_html/directory/myfile.php

Phil

Steve1318 answered 16 years ago
Steve1318 answered 16 years ago

I think you need to paste some special code into .htaccess file for that option to start to work.

Your Answer
Anonymous

Hosting Companies insights

3016 Web Hosting Reviews A trusted source of genuine reviews. Learn Reviews
2491 Web Hosting Companies Ever-growing pool of web hosting providers. Browse Providers
2898 Web Hosting Coupons Exciting web hosting deals available here Browse Coupons
Share
Tweet
Share
Share
Share
Email