Sr. Web Developer
mediabistro.com
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume

PHP Enabled Stylesheets
Principles
The main principle of this solution is that all the involved components, including the stylesheet, are PHP components that will be interpreted by the web server before being offered to the user. All the involved components will therefore be named with a .php file extension but the visual configuration one that will use a .inc extension (include PHP file).
Illustrating this article requires the creation of three files:
  1. The CSS stylesheet stylesheet.css.php file that is a normal CSS stylesheet but including some PHP code. For that reason, and although the .css extension is kept, the file is named as a PHP file. For some reason that I don't know yet, this type of filename containing two dots can cause some problems on some operating systems. If so, simply change the filename from stylesheet.css.php to stylesheetcss.php.
  2. The visual configuration visuals.inc file that will contain the visual configuration parameters as an array of key-value pairs (similar to the WINDOWS INI file way). This file is being included in the CSS stylesheet in order to make the visual configuration parameters available to the stylesheet.
  3. The index index.php file that is our test file and will mainly contain HTML code using the styles defined in the stylesheet.
To avoid any confusion, those three files are assumed to be stored in the same directory. The location of this directory is not important as long as it is located somewhere under the root of your web server. Let's move on to the definition of the visuals.inc file.
[ Next Page ]

[Page 1]  [Page 2]  


Comments:
Broken linksDave N.10/04/05 08:26
RE: php interfaces & classesEdson Luk04/22/05 14:30
how to start creationg CSS in PHPPattan11/18/04 07:16
RE: Caution!Kaare05/22/04 15:19
RE: How is this better than...Jesus A. Domingo12/28/02 14:04
RE: Template: Separate Design from ContentsBertrand Potier12/28/02 09:57
RE: Caution!Jetboy12/21/02 14:18
RE: Caution!Jason12/19/02 09:42
MIME Typeg_a_t_e12/18/02 07:18
<STYLE> TagBrad12/17/02 23:12
Template: Separate Design from ContentsJean-Marc Molina [goa103]12/14/02 20:59
Caution!Jetboy12/14/02 16:49
Very interestingTristan Crickett12/09/02 14:39
RE: How is this better than...Timothy Western12/04/02 08:44
RE: How is this better than...Bertrand Potier12/04/02 01:59
RE: How is this better than...CrazyToon12/03/02 19:15
RE: How is this better than...Eric12/02/02 21:09
How is this better than...Ross Bemrose11/28/02 07:48
 

If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly.

Add A Comment:

Name:

Email:

Subject:

Message:

To reduce spam posts, messages are now manually approved

You are not [logged in]. That means your account will not get credit for this post.