Random Background Color With PHP

The PHP random function (rand()) can be use to random webpage background color. Use this syntax on HTML body


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
</head>
<body bgcolor="<?php echo"#".rand(996699,999999); ?>">
</body>
</html>


Save this code in filetipe of PHP in your server. Then you can check what happen in your browser background color.

The 996699 is the first input color and 999999 is the second input color that use in rand() function.

You can change the color range by 000000 (black) to FFFFFF (white).

Komentar FB


Probably Related Article



1 comments:

度奉賢張瑞龍傳承LGSUN孫良哲信服台北不婚獨子 臺獨 said...
May 13, 2009 at 2:07 AM

悉怛多缽怛囉阿門 色彩心理學 color
:user.nksh.tp.edu.tw/studio/classroom/design/ c_sense.htm

Related Posts by Categories



Widget by