Discover the top-rated web hosting providers with trusted reviews, expert comparisons, and the latest deals.
Select Currency 7 Currencies
Select Region 9 Editions
VPS Hosting

VPS (Virtual Private Server) hosting is highly popular these days, and there are VPS plans available for small, medium, and even huge business websites!

In comparison to dedicated servers, VPS is pretty low-cost, and your enterprise remains independent if you buy a VPS plan!

Cheap Hosting

If you're starting your first website, you want to spend less on premium web hosting, worry about website performance, or know anything about CPU cores. You only need to consider usability, customer service, and long-term scalability.

Our experts have compiled a list of cheap hosting providers that combine affordability and reliability.

TheWebHostingDIR
DISCUSSION Other

PHP and Includes not working

Asked by Rahul Vaghasia
19 years ago
4,533 views
2 answers

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.

2 Answers

P
answered 18 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

S
answered 18 years ago

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

Your Answer

Please share accurate, constructive advice to help other community members.

Posting as Guest / Community Member
Live Preview

Posts are reviewed by moderation to maintain community quality and eliminate spam.

Link copied to clipboard!

Hosting Companies insights