Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-04-2008, 07:58 PM   PM User | #1
masterofollies
Senior Coder

 
Join Date: May 2005
Posts: 2,137
Thanks: 96
Thanked 72 Times in 72 Posts
masterofollies can only hope to improve
Background code inside a php function

Instead of setting up a css background code using a div, or by using the body bgcolor in html. Is there another way to code a background in php?

So when I go to my function its a plain white background. I would like to use some kind of coding thats like <background color="#CD73A8"> or something. Possible?
masterofollies is offline   Reply With Quote
Old 08-04-2008, 08:12 PM   PM User | #2
derzok
Regular Coder

 
Join Date: May 2008
Location: Ohio
Posts: 231
Thanks: 3
Thanked 21 Times in 21 Posts
derzok is an unknown quantity at this point
PHP is server side and won't do that. You can have PHP print something that WILL do that - but that wouldn't be php, that'd be whatever php prints (html or javascript).
__________________
zok@zoklet:~$ whereis zok
zok: http://zoklet.net | http://zoklet.net/otg | /derzok/at/gmail/dot/com
derzok is offline   Reply With Quote
Old 08-04-2008, 09:17 PM   PM User | #3
Len Whistler
Senior Coder

 
Len Whistler's Avatar
 
Join Date: Jul 2002
Location: Vancouver, BC Canada
Posts: 1,323
Thanks: 26
Thanked 100 Times in 100 Posts
Len Whistler is on a distinguished road
I would use a PHP if statement.

PHP Code:
if (true) {

echo 
"<background color=\"#CD73A8\">";

} else {
echo 
"<background color=\"#000000\">";



--------
__________________
Leonard Whistler
Len Whistler is offline   Reply With Quote
Old 08-04-2008, 09:42 PM   PM User | #4
masterofollies
Senior Coder

 
Join Date: May 2005
Posts: 2,137
Thanks: 96
Thanked 72 Times in 72 Posts
masterofollies can only hope to improve
Hmm don't have any statements needed to be true in this.

So say I put a CSS called #blah and only had a background color in it.

and in the script did echo "<div class="blah">Content here</div>";

Would that work?
masterofollies is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:08 PM.


Advertisement
Log in to turn off these ads.