<?php
/*Skrypt pochodzi z ksi±¿ki "PHP. 101 praktycznych skryptów"
  autor: Marcin Lis                    http://marcinlis.com*/
$bannersCount = 10;

function printBannerName()
{
  srand((float) microtime() * 10000000);
  $num = rand(1, $GLOBALS['bannersCount']);
  $name = "banner".$num.".gif";
  echo("<img src=\"$name\" alt=\"reklama\">");;
}
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<title>Moja strona WWW</title>
</head>
<body>
<div>
<?php printBannerName(); ?>
</div>
</body>
</html>
