Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Change Background Color using php
#1
Hello Pirate

Keep enjoy using great SF forum Smile

SCRIPT DESCRIPTION:
--------------------
This changes the colour of the background depending on the day of the week! Just place this after the (/head tag) and before the (body) tag (which you will have to take out)

With this code you can make your page more attractive, by having random colors.

CODE:
-----------
PHP Code:
<?
$today 
date("w");
$bgcolor = array(
"#FF0000""#00FF00""#0000FF""#FFFF00",
"#FF00FF""#00FFFF""#FFFFFF"
);
?>

And change the <body> tags with the following code:

PHP Code:
<body bgcolor="<? print ($bgcolor[$today] - 1);?>"
Thanks Ninja Geek for help ;)

---

That's it Smile Enjoy
Reply


Messages In This Thread
Change Background Color using php - by immi - 10-13-2009, 02:22 AM
RE: Change Background Color using php - by Gaijin - 10-13-2009, 04:31 PM
RE: Change Background Color using php - by immi - 10-14-2009, 03:14 AM
RE: Change Background Color using php - by Gaijin - 10-14-2009, 03:18 AM
RE: Change Background Color using php - by immi - 10-14-2009, 03:25 AM
RE: Change Background Color using php - by Gaijin - 10-14-2009, 03:51 AM
RE: Change Background Color using php - by immi - 10-14-2009, 06:18 AM
RE: Change Background Color using php - by Gaijin - 10-14-2009, 06:23 AM
RE: Change Background Color using php - by h1r0n - 10-16-2009, 03:47 AM
RE: Change Background Color using php - by immi - 10-16-2009, 06:23 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  PHP Framework List: An Ultimate Guide to 102 PHP Frameworks for Web Developers tk-hassan 0 956 07-27-2020, 11:26 PM
Last Post: tk-hassan
  Change warning level color with php [help] KingOfHunt3rs 0 1,110 12-04-2014, 08:45 AM
Last Post: KingOfHunt3rs
  PHP Video Tutorials (PHP For Beginners) Eleqtriq 4 3,705 10-10-2011, 01:00 PM
Last Post: Greyersting

Forum Jump:


Users browsing this thread: 6 Guest(s)