Jump to content
rootKID

a question about css/php...

Recommended Posts

hello, a quick question that might be obvoisly to me, but still needed to be answered due to my stupidness X)... is it possible to write php INTO a css file?.. like if/else statements with user sessions?.. coz i was thinking, im about to create a shoutbox for my panel, and was thinking if i somehow could get in the user table a row called like shout_background_color or something like that, with INT, then they would be able to choose like colors, background color, and so on by making if/else statements in there.. never tried it, but would like to ask here first if possible, and will it ruin the XHTML valid?... and yes, a rookie question, but even a rookie question can be wise.. lol, you get my point i suppose :P...

Share this post


Link to post
Share on other sites

It's possible, as long as you give the CSS file a .php extension. It won't affect the validity of your HTML.

Share this post


Link to post
Share on other sites
or use a .htaccess to parse .css files with the php engine
OR just do what foxy said... give the css the php ending and give it a header that says it is css.

Share this post


Link to post
Share on other sites

sorry for late reply, as usual... but a header?, what?, you mean like a normal html document basicly where css goes into header?, i dont really follow that part hehe, but nice idea anyways! :)... just that i was thinking to (try) and develop some sort of self-designing tool to my website.. if possible, so inside the css, it will get some sort of id from the database, where (example) the shoutbox_id has an extra row called shoutbox_css_bg_color or so, and then it will be int as always, and chose the css... just a long shot, but from what i hear you are saying, then it is possible, cool! x)...

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...