View Full Version : Possible firefox bug?

30-07-2010, 08:30 PM
Today in the first week of the .php course I am doing we where required to write a .php program to randomly display a a background color every time the page was loaded.

I can't remember the code exactly but it was somthing like this

echo("<BODY bgcolor(rgb($i, $u, $y)>");

with the 3 variables have a random number between 1 and 255 in them.

Although all our programs worked fine in Internet explorer, those of us who loaded it in firefox found that it wouldn't show in red in the color, just shades of green and blue.

So we tried just setting the bgcolor to red rgb(255,0,0) and it just loaded a white page.

If you would like to open the page yourself and see if it does this for you this is the link : kate.ict.op.ac.nz/~bakerrp1/rand.php

30-07-2010, 10:28 PM
Try replacing the output with <body style="background-color: rgb($i,$u,$y);"> :)

31-07-2010, 02:07 PM
Probably a stupid question but what document type are you using as bgcolor is is not supported in HTML 4.01 Strict / XHTML 1.0 Strict, IE knowing IE tends to to wave 2 fingers at the standards so it will probably be displaying it

Have a look here (http://www.w3schools.com/tags/att_body_bgcolor.asp), the previous suggestion by PCuserwinvista is the best option