note 37446 deleted from function.rand by aidan
| From: | aidan@php.net | Date: | Sat, 11 Sep 2004 07:40:11 +0000 |
| Subject: | note 37446 deleted from function.rand by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-76447@lists.php.net to get a copy of this message | ||
Note Submitter: jackylee at eml dot cc
----
// is not a complete code but enough to random select background image.
// hope this can save your time :-)
<?php
srand ((double) microtime() * 1000000);
$randnum = rand(1,4);
$tempbackground = array(
"",
"wallpaper/WinXP.jpg",
"wallpaper/26033 Full moon gulls and surf.jpg",
"wallpaper/All White.jpg",
"wallpaper/xsport20_1024.jpg",
);
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<title>calendar</title>
</head>
<body background="<?php echo $tempbackground[$randnum]; ?>"
text="#FFFFFF" link="#FFFFFF" vlink="#FFFFFF"
alink="#FFFFFF" style="background-attachment: fixed">
</body>
</html>