I am no PHP expert, but I don’t see why the line above isn’t working for you.
$_SERVER[‘DOCUMENT_ROOT’] should return ‘/home/username/domain.com’, so your complete include path would be ‘/home/username/domain.com/includes/header.php’, which should work regardless of which sub-directory the page with the include is located in.
In-fact, I just created a simple test on one of my domains. I created a small php file, /goodies/test.php, which contained the following;
[color=#0000CC]<?php include($_SERVER['DOCUMENT_ROOT'].'/includes/header.php'); ?>[/color]
I browsed to this file and it included the /includes/header.php file with no problems.
Save [color=#CC0000]$50[/color] on DreamHost plans using [color=#CC0000]PRICESLASH[/color] promo code (Click for DreamHost promo code details)