Ok, I but if I just use include, no template I get to path problems again. I may put php pages in different directories but i want to include files relative to the site root. simply putting "/" in front of the path does not work. site root, relative. <?php include("../../_scripts/nav.php") ?> is working but i'd rather not use it due to the problems i reported. <?php include("/_scripts/nav.php") ?> does not work even tough "/" should be treated as site root and _scripts dir is under site root. I tried to generate the site root like show below. This has been working for year both on my testing server and real server. i am using this so that i do not need to change anything when i upload to the server. $host = $_SERVER['HTTP_HOST']; if(strpos($host, "dnd-production.com") !== false){ $site_Root = "http://$host"; } else { $uri = explode("/", $_SERVER['PHP_SELF']); //print_r($uri); $site_Root = "//$host/$uri[1]/"; } $file = $site_Root."/_scripts/nav.php"; i get this error: Warning: require_once(//localhost/mySite/_scripts/nav.php): failed to open stream: No such file or directory in To remove any doubt that my $site_Root is correct i can say that when i use it, in the same page, on html links it is working. This is working: <link href="<?php echo siteRoot()?>/css/mediaQuery.css" rel="stylesheet" type="text/css"> So again, what is going on with php links???
... View more