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

  • SEARCH
  • Home
  • 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 4122848
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T23:32:07+00:00 2026-05-20T23:32:07+00:00

Can I put this in my HTML <head> ? <link rel=stylesheet href=http://site.com/some/php/script/userid/style.php /> Basically,

  • 0

Can I put this in my HTML <head>?

<link rel="stylesheet" href="http://site.com/some/php/script/userid/style.php" />

Basically, can I pass a user ID via a URI segment (or a GET variable) to a PHP script – which will still be validly treated as a stylesheet?

So, for example, if in my webapp a user has a custom CSS stylesheet for their page, I can just load it up dynamically in my controller by outputting this as the stylesheet URL – is this possible? I know the PHP part is certainly possible, but will this still be valid or fully browser/server compatible?

Thanks!

  • 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. Editorial Team
    Editorial Team
    2026-05-20T23:32:08+00:00Added an answer on May 20, 2026 at 11:32 pm

    I am assuming you’re asking “will this work?” and not “is this valid HTML?” for that, See @Gordon’s answer.

    If your PHP script outputs a text/css content type and valid CSS, this will work fine.

    header("Content-type: text/css");
    

    This header is necessary for FF to interpret the CSS. See here why.

    It will be desirable to add some caching headers as well, otherwise the resource will probably be requested on every page load.

    However…

    If you need to output dynamic CSS, consider having a static style sheet (i.e. one that does not get interpreted by PHP) with all the generic stuff, and adding dynamic data in the document’s head:

    <link rel="stylesheet" href="http://site.com/resources/style.css" />
    
    <style type="text/css">
      .userText { color: <?php echo $userTextColor; `> }
      etc. etc. 
    </style>
    

    this way, the CSS resource can remain a static file. It will not require starting a PHP process to get served. If your CSS parameters change from page to page, this will save you a HTTP request.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm about to put my head thru this sliding glass door. I can't figure
Is this functionality going to be put into a later Java version? Can someone
How can I construct my ajaxSend call, this seems like the place to put
Okay, I know it is weird but when I put this code between <head
I made this PHP chatbox which supports some JavaScript code. I have these 'images'
I am wondering if someone can put a bit of an authoritative reference summary
With VIM or Emacs I can put comments in the file that will be
I want to show a label rotated 90 degrees (so I can put a
In particular I'm looking for an IP address that I can put in my
I've just installed CodeGear Studio 2009 and I didn`t find where I can put

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.