At the top of a PHP file I declare a variable then use it to point to some files I want to include.
Thus sindext.php:
The hdr-sin1.php:
...and the hdr-sin2.php:
Lastly the tree:
site
--des
----sindext.php
--inc
----ftr-sin.php
----hdr-sin1.php
----hdr-sin2.php
----sin.css
Please note that the first thing I do is declare the variable; and that the CSS and the includes are in the same directory.
The issue: When I open the page in the browser and look at the generated HTML the URLs are rendered correctly. However while the PHP includes work perfectly, the CSS does not. I'm using the same variable for the includes and the stylesheet; the first works the second does not.
When I use the absolute path without the variable for the <link> the CSS still does not work. I've tried several ways of stating the absolute path, with and without the variable: http://[domain][path], /nfs/www[path], I've checked them carefully, same results.
The EXACT SAME PATH works for the includes but not for the CSS.
What am I missing?
thanks
RACER
Thus sindext.php:
Code: Select all
<?php
$siteroot="/nfs/www/WWW_pages/racerlupine/slavehouse.org/site";
include "$siteroot/inc/hdr-sin1.php";
?>
<title>]nlr[ HOME PAGE</title>
<?php include "$siteroot/inc/hdr-sin2.php"; ?>
[some html goes here]
<?php include "$siteroot/inc/ftr-sin.php"; ?>
Code: Select all
<!DOCTYPE html>
<html lang="en"><head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" charset="utf-8">
<link rel="stylesheet" type="text/css" href="<?php echo "$siteroot/inc/sin.css"; ?>">
Code: Select all
</head><body id="bodyxx">
site
--des
----sindext.php
--inc
----ftr-sin.php
----hdr-sin1.php
----hdr-sin2.php
----sin.css
Please note that the first thing I do is declare the variable; and that the CSS and the includes are in the same directory.
The issue: When I open the page in the browser and look at the generated HTML the URLs are rendered correctly. However while the PHP includes work perfectly, the CSS does not. I'm using the same variable for the includes and the stylesheet; the first works the second does not.
When I use the absolute path without the variable for the <link> the CSS still does not work. I've tried several ways of stating the absolute path, with and without the variable: http://[domain][path], /nfs/www[path], I've checked them carefully, same results.
The EXACT SAME PATH works for the includes but not for the CSS.
What am I missing?
thanks
RACER