<?php
function generujPrzyciski()
{
  $kategorie = array
  (
    "1" => "JavaScript",
    "2" => "PHP",
    "3" => "AJAX"
  );
  foreach($kategorie as $id => $kategoria){
    echo "<input type='button' value='$kategoria' id='btn$id'";
    echo "onclick='wyslijDane($id);' class='myButton' ";
    echo "style='width:100px;'/> &nbsp;";
  }
}
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Ajax</title>
<link href="ajaxcss.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="ajaxcore.js"></script>
<script type="text/javascript" src="ajax.js"></script>
</head>
<body>
<div id="headDiv" class="mainDiv">
<?php generujPrzyciski(); ?>
</div>
<div id="dataDiv" class="dataDiv">
</div>
</body>
</html>
