Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 137109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:03:16+00:00 2026-05-11T07:03:16+00:00

I have created css page called style.php and included this the top: <?php header(Content-type:

  • 0

I have created css page called style.php and included this the top:

<?php header('Content-type: text/css'); ?>

Does this make you cringe. Is it a terrible idea? I am doing this because I have created a CMS that allows the admin to control colors on pages (so the style.php script queries the database and grabs the hex values).

Any thoughts?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T07:03:17+00:00Added an answer on May 11, 2026 at 7:03 am

    This is a fine solution, just make sure that you are serving up the appropriate headers. See my blogpost about a related topic (search for ‘The important headers are’ to get to the right section).

    One more thing:

    With the caching you might get into the situation where the user changes the color she wants to see, but (because it is cached at the client), the page doesn’t update. To invalidate the cache, append a ?=id at the end of the URL, where ID is a number that is stored for the user (for example in the session) and is incremented every time she changes the color scheme.

    Example:

    • At first the user has a stylesheet of http://example.com/style.php?id=0
    • When she changes the colors, she will get the url of http://example.com/style.php?id=1 and so on.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created tab style interface using css and javascript with only two tabs
I have created a custom style sheet that overrides the original CSS for my
I have this AJAX loader, created using CSS. And I m trying to increase
I have created an HTML page which uses simple CSS (no javascript) for menu
I have created a master page in asp.net which uses the following css to
I have a CSS vertical menu I have created code is below. (Test page
I have created a CSS stylesheet for my project. Is there any way I
I have created a button CSS class that uses background images with different positions
I'm using Drupal 6 and have created 2 equal columns in layout.css In the
I have a custom styled drop-down selection box created with CSS/Javascript, which is meant

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.