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 12 years ago
PhilMeyer answered 12 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 12 years ago
Steve1318 answered 12 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

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