tefflox Posted June 26, 2006 Share Posted June 26, 2006 the idea is to make an elliptical favicon of random color that is new for each page load. here's what i've got so far. the page / source is [url=http://listenlight.net/createpng.php]http://listenlight.net/createpng.php[/url]What am I missing?[code]<?phpfunction 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)); imagefilledellipse($img, 8, 8, 12, 16, $ec); //header("Content-type: image/png"); imagepng($img); return $img; } ?><?php$favipng = randomFavicon(); echo( "<link rel=\"icon\" href=\"".$favipng."\" type=\"image/x-icon\" /><br /><link rel=\"shortcut icon\" href=\"".$favipng."\" type=\"image/x-icon\" /><br />"); echo ( "<title> testing </title>" );?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/12894-newbie-project-random-favicon/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.