<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1027608" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1027608</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/too-much-css-my-css-file#comment-1164297</link>
    <description> &lt;p&gt;@IMPORT only supplies GET POST and Cookie variables, not CSS, always remember CSS is clientside, and php is serverside. There are a lot of fancy ways that it could be done, including having the CSS file a php file.&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;styles.php?style=pagename&amp;quot; title=&amp;quot;Additional Style&amp;quot; type=&amp;quot;text/css&amp;quot;&amp;gt;&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;then all you have to do is a series of ifs or breaks in a php file:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;?&lt;br /&gt;&lt;br /&gt;if($style == &amp;#039;blue&amp;#039;)&lt;br /&gt; {&lt;br /&gt;print(&amp;quot;&lt;br /&gt;body {&lt;br /&gt; color: blue;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;quot;);&lt;br /&gt; }&lt;br /&gt;else&lt;br /&gt; {&lt;br /&gt;print(&amp;quot;&lt;br /&gt;body {&lt;br /&gt; color: black;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;quot;);&lt;br /&gt;}&lt;br /&gt;?&amp;gt;&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;You could even replace your main file with a php one, and remember, php files don&#039;t have to be 100% php, so you can just have some ifs for certain pages that need calling, and no ?style=whatever after the CSS filename.&lt;/p&gt;
 </description>
     <pubDate>Sun, 16 Jan 2005 10:30:30 +0000</pubDate>
 <dc:creator>CptAwesome</dc:creator>
 <guid isPermaLink="false">comment 1164297 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/too-much-css-my-css-file#comment-1164198</link>
    <description> &lt;p&gt;Oooo.  I had an idea about this very minor issue and I wanted to know if this is a possible easy solution.&lt;/p&gt;
&lt;p&gt;Most of my pages that require great amounts of special css codes are within a directory other than the main public_html.  Like instead of domain.com/page.php it would (or could be forced to be) domain.com/directory/page.php.  So if I decide to name all of my special css files the same name, just like having an index.php file in each directory, I can have &quot;additionalstylestyle.css&quot; in each directory without them interfereing with eachother.  So now my question is this:  Since I can call files in the same directory by simply not using the full path/url or slash characters, can&#039;t I just make some php statement that says &quot;if &#039;additionalstyle.css&#039; exists in this directory then include it?&lt;/p&gt;
&lt;p&gt;So question #1 was &quot;will this idea work&quot;?  Question #2 is &quot;will this actual code work properly to accomplish this?&quot;  I made up the code below by throwing together a few snippets I found but I have no idea if this is valid code (I don&#039;t even have a clue as to what that that &quot;r&quot; is for) .&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;/style.css&amp;quot; title=&amp;quot;Default Blue&amp;quot; type=&amp;quot;text/css&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;? $file=&amp;quot;additionalstyle.css&amp;quot;;&lt;br /&gt;if (@fclose(@fopen(&amp;quot;$file&amp;quot;, &amp;quot;r&amp;quot;))) {&lt;br /&gt;print(&amp;quot;&amp;lt;link rel=\&amp;quot;stylesheet\&amp;quot; href=\&amp;quot;additionalstyle.css\&amp;quot; title=\&amp;quot;Additional Style\&amp;quot; type=\&amp;quot;text/css\&amp;quot;&amp;gt;&amp;quot;);&lt;br /&gt;} else {&lt;br /&gt;print(&amp;quot;&amp;lt;!-- no additional css files found --&amp;gt;&amp;quot;);&lt;br /&gt;}&lt;br /&gt;?&amp;gt; &lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;P.S.  I still don&#039;t understand the difference between using link rel=&quot;stylesheet&quot;  or @import to use and external css file.  Does it matter which method is used?&lt;/p&gt;
 </description>
     <pubDate>Thu, 13 Jan 2005 14:48:30 +0000</pubDate>
 <dc:creator>fifeclub</dc:creator>
 <guid isPermaLink="false">comment 1164198 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/too-much-css-my-css-file#comment-1163711</link>
    <description> &lt;p&gt;Hmmm.  I think you&#039;re right about reinventing the wheel in my case.  Especially when my &quot;problem&quot; is just my inconvenience of not ultra-organizing my css into seperate files.  In reality everything works fine (loading all the CSS even if it&#039;s not used on that page)&lt;/p&gt;
&lt;p&gt;But anyhow, to answer your questions - &lt;/p&gt;
&lt;p&gt;I&#039;m just taking a guess but does CMS mean Content Management System?  If so, none. Except for occasionally adding news to my homepage thru an online script, most page content is typed directly into text files at home and then uploaded via FTP.  Stoneaged I know but that&#039;s all I think I need.  &lt;/p&gt;
&lt;p&gt;To answer your question about how my files are structured, here&#039;s a few examples to help you figure out how simple-minded I do things &lt;a href=&quot;http://www.mikesussman.com/&quot; class=&quot;bb-url&quot;&gt;[1]&lt;/a&gt; &lt;a href=&quot;http://www.hampton-homes.net/&quot; class=&quot;bb-url&quot;&gt;[2]&lt;/a&gt;.  Note that those examples were done long before I learned how to use CSS correctly, so ignore the crappy code and just look at the page urls to get an idea about how I organize things and rarely use anything but static page urls.  The only thing I think you won&#039;t be able to see is how each page is set up before the includes.  All the non-script pages work like this&lt;/p&gt;
&lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;Quote: 1) simple php call to include header (including menu)&lt;br /&gt;
2) unique page content&lt;br /&gt;
3) simple php call to include footer&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Regarding scripts I use, some sites like example #2 above have no scripts, while I often use the news script and gallery script found in example #1 above.  Maybe an occasional guestbook script (which died in my homepage and I haven&#039;t fixed it yet)&lt;/p&gt;
 </description>
     <pubDate>Tue, 04 Jan 2005 17:39:57 +0000</pubDate>
 <dc:creator>fifeclub</dc:creator>
 <guid isPermaLink="false">comment 1163711 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/too-much-css-my-css-file#comment-1163710</link>
    <description> &lt;p&gt;Let&#039;s be more general. What you want is&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;if ( this is the home page ) {&lt;br /&gt;&amp;nbsp; echo &amp;#039;&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;/style_home.css&amp;quot; type=&amp;quot;text/css&amp;quot;&amp;gt;&amp;#039;;&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;What we need is a way to check whether &quot;this is the home page&quot;.&lt;/p&gt;
&lt;p&gt;One way of doing this is if you are using a system that loads pages based on query string variables (GET), you can check that. How the query string works with PHP is:&lt;/p&gt;
&lt;ul class=&quot;bb-list&quot;&gt;
&lt;li&gt;You have a url to &lt;strong&gt;index.php?mypage=contactme&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;In the special array &lt;strong&gt;$_GET&lt;/strong&gt;, an element is created called &lt;strong&gt;$_GET[&#039;mypage&#039;]&lt;/strong&gt;. Its value is &quot;contactme&quot;&lt;/li&gt;
&lt;li&gt;You might then have your PHP code do something like &lt;strong&gt;include($_GET[&#039;mypage&#039;] . &quot;.php&quot;)&lt;/strong&gt; -- that is, it will &lt;strong&gt;include(&quot;contactme.php&quot;)&lt;/strong&gt; into your page.&lt;/li&gt;
&lt;li&gt;Whereas you currently probably have separate pages that call on constant header/footer files, using this system you&#039;d have one index.php file that selects different &quot;body&quot; files&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can use this to your advantage for loading CSS files, among other things. If &lt;strong&gt;index.php?mypage=home&lt;/strong&gt; loads your home page, you can slot that into the &lt;strong&gt;if()&lt;/strong&gt; control above.&lt;/p&gt;
&lt;p&gt;Of course, to refine all this, you&#039;d be swimming in if()s or switch()s, and you&#039;d basically reinvent the wheel (in this case, a CMS or template system).&lt;/p&gt;
&lt;p&gt;Another way of doing this is to see what options your existing system offers you to detect which page you&#039;re on. Are you using a CMS? What PHP scripts are you using? How are your files structured?&lt;/p&gt;
 </description>
     <pubDate>Tue, 04 Jan 2005 15:54:42 +0000</pubDate>
 <dc:creator>Abhishek Reddy</dc:creator>
 <guid isPermaLink="false">comment 1163710 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/too-much-css-my-css-file#comment-1163707</link>
    <description> &lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;&lt;strong&gt;Renegade wrote:&lt;/strong&gt; $_GET variables are variables from the URL so in this case, $_GET[&#039;page&#039;] would be from the index.php?page=thispage and would have a value of &quot;thispage&quot;&lt;/p&gt;
&lt;p&gt;In the above example, I was refering to the page &quot;home.php&quot; not &quot;/home/&quot; although it could be anything. &quot;home&quot; is from the GET variable in the URL index.php?page=home&lt;/p&gt;
&lt;p&gt;Do you get it? If not, say so and I&#039;ll try explain it again.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;I thought I understood when you said &quot;I was refering to the page &quot;home.php&quot;&quot; but then I lost it when you said &quot;index.php?page=home&quot;   &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/surprise.png&quot; title=&quot;Shocked&quot; alt=&quot;Shocked&quot; class=&quot;smiley-content&quot; /&gt;  I&#039;ve seen other sites change pages with something like ?page= but I only know how to hard code pages.  In short, I is still a bit confuzzed.  &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/confused.png&quot; title=&quot;Confused&quot; alt=&quot;Confused&quot; class=&quot;smiley-content&quot; /&gt; (Sorry)&lt;/p&gt;
 </description>
     <pubDate>Tue, 04 Jan 2005 14:07:42 +0000</pubDate>
 <dc:creator>fifeclub</dc:creator>
 <guid isPermaLink="false">comment 1163707 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/too-much-css-my-css-file#comment-1163692</link>
    <description> &lt;p&gt;$_GET variables are variables from the URL so in this case, $_GET[&#039;page&#039;] would be from the index.php?page=thispage and would have a value of &quot;thispage&quot;&lt;/p&gt;
&lt;p&gt;In the above example, I was refering to the page &quot;home.php&quot; not &quot;/home/&quot; although it could be anything. &quot;home&quot; is from the GET variable in the URL index.php?page=home&lt;/p&gt;
&lt;p&gt;Do you get it? If not, say so and I&#039;ll try explain it again.&lt;/p&gt;
 </description>
     <pubDate>Tue, 04 Jan 2005 10:09:21 +0000</pubDate>
 <dc:creator>Renegade</dc:creator>
 <guid isPermaLink="false">comment 1163692 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/too-much-css-my-css-file#comment-1163681</link>
    <description> &lt;p&gt;I only have 3 or 4 special pages which need their own special css codes (on top of my regular site-wide css code).  So I suppose I could have one standard css link and then additional css files load only from the if/then php.  But I can&#039;t see more than 2 or 3 css files ever needing to be loaded and used on a page at the same time.&lt;/p&gt;
&lt;p&gt;Question about the code you wrote.  Sounds like that&#039;s along the same lines I was thinking only more efficient.  I barely use enough raw php to recognize that I&#039;ve seen  GET[&#039;page&#039;] before but I&#039;m unclear on how that exactly works.  In your example would &quot;home&quot; need to be the file name like home.php or a directory name like /home/ ?  Don&#039;t laugh:laugh:,  I hardly ever use straight php except for calling my header and footer or a pre-mader script.&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;
 </description>
     <pubDate>Tue, 04 Jan 2005 02:53:36 +0000</pubDate>
 <dc:creator>fifeclub</dc:creator>
 <guid isPermaLink="false">comment 1163681 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/too-much-css-my-css-file#comment-1163678</link>
    <description> &lt;p&gt;Wouldn&#039;t a simple PHP (I&#039;m assuming you have PHP) if() function work?&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;if($_GET[&amp;#039;page&amp;#039;] == &amp;quot;home&amp;quot;) {&lt;br /&gt;echo &amp;#039;&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;/style_home.css&amp;quot; type=&amp;quot;text/css&amp;quot;&amp;gt;&amp;#039;;&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;This does, of course, get a bit messy if you need a lot of different CSS files for different pages.&lt;/p&gt;
&lt;p&gt;The other alternative, would be to look through your CSS and take out what you need. In other words, streamline your CSS.&lt;/p&gt;
 </description>
     <pubDate>Tue, 04 Jan 2005 00:42:07 +0000</pubDate>
 <dc:creator>Renegade</dc:creator>
 <guid isPermaLink="false">comment 1163678 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
