Good Morning.

I'm hoping someone can tell me why this isn't working, or maybe if it isn't supposed to work.

I've been reading on various websites that you can use variables within CSS if you don't save the style sheet as a .css, but rather as a .php and just tell the script the the content is text/css.

So I tried it. Using a known good css file, I copied the content into a new page and saved it as style.php

at the top of the page I put:

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

and left the balance of the code alone

Then on the index page that references the stylesheet I put:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">

  <title>mhaonlinegrocery.com</title>
  <meta name="description" content="Easy to use Shop at Home Grocery Service that Delivers your Non-Perishable groceries direct to your door Free of shipping charges">
  <meta name="keywords" content="discount grocery, discount, groceries, shop at home, Free Delivery, Brand Name Groceries, savings">
    <link href=”style.php” rel=”stylesheet” type=”text/css” />
</head>

What happened after uploading to the server is that I lost all of the styling from the CSS.

Any suggestions on how to make this work?

The reason for the change over is so I can use variables in a members site so they can change the look and feel of their individual site, by simply changing color values in their back office.

Thanks in advance for your feedback.

Douglas

Recommended Answers

All 2 Replies

Are the quotes you use just copied wrong ? Because they are not single nor double quotes.

Pritaeas,

Thank you for your reply. Didn't realize you replied, but did find that to be the issue.

As soon as I replaced the copied quotes with true quotes, it worked fine.

Isn't it amazing how something so simple can cause so much trouble...

Thanks again
Douglas

this is another issue solved...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.