Jump to content


Photo

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


  • Please log in to reply
5 replies to this topic

#1 rajmohan

rajmohan
  • Members
  • PipPipPip
  • Advanced Member
  • 169 posts

Posted 15 September 2006 - 08:25 AM

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

#2 Jenk

Jenk
  • Members
  • PipPipPip
  • Advanced Member
  • 778 posts

Posted 15 September 2006 - 08:28 AM

elaborate what you mean by "change through php"

Before the page is loaded?

After the page is loaded? (Not possible)

#3 rajmohan

rajmohan
  • Members
  • PipPipPip
  • Advanced Member
  • 169 posts

Posted 15 September 2006 - 08:31 AM

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

#4 markbett

markbett
  • Members
  • PipPipPip
  • Advanced Member
  • 133 posts

Posted 15 September 2006 - 08:35 AM

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......

#5 rajmohan

rajmohan
  • Members
  • PipPipPip
  • Advanced Member
  • 169 posts

Posted 15 September 2006 - 08:36 AM

sorry i am new to field please guide me how to write the file


#6 markbett

markbett
  • Members
  • PipPipPip
  • Advanced Member
  • 133 posts

Posted 15 September 2006 - 08:44 AM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users