# using variables in stylesheets

**URL:** <https://www.phphelp.com/t/using-variables-in-stylesheets/21517>\
**Category:** General PHP Help\
**Created:** [November 13, 2013, 7:28am UTC](https://www.phphelp.com/t/using-variables-in-stylesheets/21517 "2013-11-13T07:28:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://www.phphelp.com/uploads/default/original/2X/2/243e9ed5d93c5653ce3186f18df16e019ce38445.png) [@system](https://www.phphelp.com/u/system)\
**Post date:** [November 13, 2013, 7:28am UTC](https://www.phphelp.com/t/using-variables-in-stylesheets/21517/1 "2013-11-13T07:28:48Z")

</div>

I have a series of domain names and pages that all use stylesheets with the same elements but different variables for each element depending on the domain name and page. I’m planning on storing all of the variables associated with each domain name into a database.

The HTML web page at each domain name will include:

The page that contains the stylesheet code above must be an HTML page and not a PHP page due to the restrictions of the web server. I know how to do all of that.

I need the domain name associated each page (and preferable the entire URL) that calls styles.php to be passed to styles.php as a variable so I can get the proper database variables.

I had hoped that by placing this on the common PHP stylesheet page that I’d know which page called that stylesheet:  
$referer = $\_SERVER[‘HTTP\_REFERER’];

However, apparently the web pages that calls the PHP page for the stylesheet isn’t set with $\_SERVER[‘HTTP\_REFERER’]. Any suggestion on how to tell what page is calling the PHP stylesheet so that I can pull the variables would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![Topcoder](https://www.phphelp.com/user_avatar/www.phphelp.com/topcoder/32/4356_2.png) [@Topcoder](https://www.phphelp.com/u/Topcoder)\
**Post date:** [November 13, 2013, 4:25pm UTC](https://www.phphelp.com/t/using-variables-in-stylesheets/21517/2 "2013-11-13T16:25:42Z")

</div>

Try Something like this…

[php]\<?php  
echo $\_SERVER[‘SERVER\_NAME’];  
?\>[/php]
