Jump to content

Archived

This topic is now archived and is closed to further replies.

rajmohan

HELP PLEASE ----------- how to call PHP inside CSS?

Recommended Posts

Hello guys,


I am using css

body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-color: #FF0066;
}

for background color,

i what to change the background color througt php whether it is posible please help me

Share this post


Link to post
Share on other sites
elaborate what you mean by "change through php"

Before the page is loaded?

After the page is loaded? (Not possible)

Share this post


Link to post
Share on other sites
i need like this


body {
  margin-left: 0px;
  margin-top: 0px;
  margin-right: 0px;
  margin-bottom: 0px;
  background-color: <? $colorinsert; ?>
}

this what i need help

because i am generating a page where they can also change the background color

Share this post


Link to post
Share on other sites
then what you need to do is have PHP write the css file...... well i guess you could tell the webserver that CSS files should be processed by PHP by adding the css extension, then the php engine would go through nad parse that all out......

Share this post


Link to post
Share on other sites
if you are using inline css then you just need to make sure the php engine parses the file... give it a php extension

http://www.tizag.com/cssT/inline.php

if you arent using inline css then you need to set your webserver to have php process css files.  if you want help doing that then talk to your sys admin

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.