OsakaWebbie
Programmer
I'm using PHP to construct my CSS output, like this:
Multiple files have the above line in them, and I want to serve up some specific content based on which file is calling it.
My thought was to have a switch statement with cases of the different filenames that need specific content, and I figured there was an environment variable that would contain the name (or path - I don't care) of the file that is linking the CSS (e.g. "search.php" or "list.php"). I checked a few, using a trick like this:
But the few I tried all contained "style.php" itself, not the parent. I couldn't seem to use print_r($_SERVER) in that spot to get the whole array at once, so I'm shooting in the dark. Does anyone know how I can have visibility of the 'parent' filename?
HTML:
<link rel="stylesheet" type="text/css" href="style.php" />
My thought was to have a switch statement with cases of the different filenames that need specific content, and I figured there was an environment variable that would contain the name (or path - I don't care) of the file that is linking the CSS (e.g. "search.php" or "list.php"). I checked a few, using a trick like this:
CSS:
#diag:after { content:"<?=$_SERVER['REQUEST_URI']?>"; }