trying to make random favicons
Posted: Sun Jun 25, 2006 3:52 pm
I'm new to web development. You can see the extent of my php experience at http://listenlight.net/hello.php
Now I'm trying to make random favicons. Here is what I've got so far..
if I can get that to work, then I have to figure out how the link works. What to do?
Now I'm trying to make random favicons. Here is what I've got so far..
Code: Select all
<?php
function randomFavicon() {
$img = imagecreatetruecolor(16, 16); /* Create a blank image */
$bgc = imagecolorallocate($img, rand(1,160), rand(1,160),rand(1,160));
$ec = imagecolorallocate($img, rand(1,160), rand(1,160),rand(1,160));
if( imagefilledellipse($img, 8, 8, 12, 16, $ec) ) {
header("Content-type: image/png");
imagepng($img);
return $img;
} else ??
?>