Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    Senior Member tekp's Avatar
    Join Date
    Jan 2004
    Location
    A small village near a small city near a small cit
    Posts
    918
    Member #
    4667
    Liked
    1 times
    You know how, with RSS, you can get .htaccess to treat .php files as .xml files so you can generate your feeds with PHP?

    Could you get .htaccess to treat .css.php files as .css? In this way you could have a file named style.css.php:

    PHP Code:
    <?
     
    print "body { background-color:black; }";
    ?>
    and a HTML page with

    HTML Code:
    <link rel="stylesheet" href="style.css.php" />
    Would render the CSS and have a black background?

    Thanks

    I tried

    AddType application/x-httpd-php .css
    But then any stylesheets weren't applied to the pages they were linked to. Presumably the server thought I was trying to use .php files as a stylesheet and stopped it?

    Any suggestions? :/
    tekp :cheeky: tekponline.com

  2.  

  3. #2
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Try adding the `type="text/css"' attribute to the HTML link element. Alternatively, make all .css.php files start with [minicode]header( 'Content-Type: text/css' );[/minicode], which should also work.

  4. #3
    Senior Member tekp's Avatar
    Join Date
    Jan 2004
    Location
    A small village near a small city near a small cit
    Posts
    918
    Member #
    4667
    Liked
    1 times
    Yeah! The latter worked, clever! Thanks very much
    tekp :cheeky: tekponline.com

  5. #4
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Cool. Np.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 09:33 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com