Nightchild
11-16-2007, 01:56 AM
Running into problems with relative paths for various files. I'm trying to segregate related scripts into their own folders. ie header & footer into a template folder. admin functions into an admin folder etc...
I'm running into the most basic problems such as - a page in the admin folder includes the header file.
include("../template/header.inc.php");
The header file is being included ok but the CSS link inside the header file isn't correct.
echo ' <link rel="stylesheet" type="text/css" href="' .$APP_BASE. '/template/screen.css" media="screen" />';
$APP_BASE is created using
$APP_BASE = '//' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
The generated CSS link turns out as:
<link rel="stylesheet" type="text/css" href="//nexus/raw/admin/template/screen.css" media="screen" />
How do I create these links properly? I can't use "../template/screen.css" because I have a few general files which are in the application root. Using the "../" causes the file path to be in the server root in that case.
Appreciate the help.
I'm running into the most basic problems such as - a page in the admin folder includes the header file.
include("../template/header.inc.php");
The header file is being included ok but the CSS link inside the header file isn't correct.
echo ' <link rel="stylesheet" type="text/css" href="' .$APP_BASE. '/template/screen.css" media="screen" />';
$APP_BASE is created using
$APP_BASE = '//' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
The generated CSS link turns out as:
<link rel="stylesheet" type="text/css" href="//nexus/raw/admin/template/screen.css" media="screen" />
How do I create these links properly? I can't use "../template/screen.css" because I have a few general files which are in the application root. Using the "../" causes the file path to be in the server root in that case.
Appreciate the help.