{"id":1338,"date":"2018-01-19T19:22:43","date_gmt":"2018-01-19T19:22:43","guid":{"rendered":"http:\/\/goofy-trucks.flywheelsites.com\/php-enabled-stylesheets-page-2\/"},"modified":"2018-01-19T19:24:42","modified_gmt":"2018-01-19T19:24:42","slug":"php-enabled-stylesheets-page-2","status":"publish","type":"post","link":"https:\/\/phpbuilder.com\/php-enabled-stylesheets-page-2\/","title":{"rendered":"PHP enabled stylesheets Page 2"},"content":{"rendered":"<div class=\"phpbuilder-content\">\n<div class=\"phpbuilder-meta\">\n<div class=\"\">By Bertrand Potier<\/div>\n<div class=\"\">on November 24, 2002<\/div>\n<\/p><\/div>\n<div id=\"overflow-content\">\n<h2>Principles<\/h2>\n<div class=\"articlePara\">The main principle of this solution is that all the involved components,<br \/>\nincluding the stylesheet, are PHP components that will be interpreted by the web<br \/>\nserver before being offered to the user. All the involved components will<br \/>\ntherefore be named with a <code class=\"example\">.php<\/code> file extension but the visual<br \/>\nconfiguration one that will use a <code class=\"example\">.inc<\/code> extension (include PHP<br \/>\nfile).<br \/>Illustrating this article requires the creation of three files: <\/div>\n<div class=\"articleList\">\n<ol>\n<li>The CSS stylesheet <code class=\"example\">stylesheet.css.php<\/code> file that is a normal<br \/>\n  CSS stylesheet but including some PHP code. For that reason, and although the<br \/>\n  <code class=\"example\">.css<\/code> extension is kept, the file is named as a PHP file. For some<br \/>\n  reason that I don&#8217;t know yet, this type of filename containing two dots can<br \/>\n  cause some problems on some operating systems. If so, simply change the<br \/>\n  filename from <code class=\"example\">stylesheet.css.php<\/code> to<br \/>\n  <code class=\"example\">stylesheetcss.php<\/code>. <\/li>\n<li>The visual configuration <code>visuals.inc<\/code> file that will contain<br \/>\n  the visual configuration parameters as an array of key-value pairs (similar to<br \/>\n  the WINDOWS INI file way). This file is being included in the CSS stylesheet<br \/>\n  in order to make the visual configuration parameters available to the<br \/>\n  stylesheet. <\/li>\n<li>The index <code class=\"example\">index.php<\/code> file that is our test file and will<br \/>\n  mainly contain HTML code using the styles defined in the stylesheet. <\/li>\n<\/ol>\n<\/div>\n<div class=\"articlePara\">To avoid any confusion, those three files are assumed to be stored in the<br \/>\nsame directory. The location of this directory is not important as long as it is<br \/>\nlocated somewhere under the root of your web server. Let&#8217;s move on to the<br \/>\ndefinition of the <code class=\"example\">visuals.inc<\/code> file. <\/div>\n<\/div>\n<p><\/p>\n<div style=\"float: left; padding:15px; color:#17AAF3\">\n<div style=\"float:left; padding:2px;\"><a class=\"paginationPageLink\" href=\"potier20021122.html\">\u00ab Previous Page<\/a><\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"potier20021122.html\">1<\/a> <\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"background-color:#B6E5FC; font-size:16px; margin-top:1px; padding:1px 4px 1px 4px; color:#000; font-style:bold; float:left;\">2<\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"potier200211229ba9.html?page=3\">3<\/a> <\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"potier20021122fdb0.html?page=4\">4<\/a> <\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"potier20021122af4d.html?page=5\">5<\/a> <\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"potier20021122c575.html?page=6\">6<\/a> <\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"potier20021122235c.html?page=7\">7<\/a> <\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"potier20021122fdfa.html?page=8\">8<\/a> <\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"potier200211220b08.html?page=9\">9<\/a> <\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"potier200211221448.html?page=10\">10<\/a> <\/div>\n<div style=\"float:left; padding:2px;\"><a class=\"paginationPageLink\" href=\"potier200211229ba9.html?page=3\">Next Page \u00bb<\/a><\/div>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>From Perl scripts to PHP, a lot of technologies are today available to move HTML to the dynamic age but why not, going even further and do the<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1338","post","type-post","status-publish","format-standard","hentry","category-tutorials"],"_links":{"self":[{"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/posts\/1338","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/comments?post=1338"}],"version-history":[{"count":1,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/posts\/1338\/revisions"}],"predecessor-version":[{"id":3224,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/posts\/1338\/revisions\/3224"}],"wp:attachment":[{"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/media?parent=1338"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/categories?post=1338"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/tags?post=1338"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}