if isste
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>www.yazilimkodlama.com</title>
<style>
.kutu{
background-color:red;
width:150px;
height:150px;
margin:5px;
float:left;
color:white;
}
.kutu1{
background-color:blue;
width:150px;
height:150px;
margin:5px;
float:left;
color:white;
}
</style>
</head>
<body>
<form method="post"action="">
<input type="text"name="adet">
<input type="submit"name="olustur"value="Oluştur">
</form>
<?php
if(isset($_POST['olustur'])){
for($i=1;$i<=$_POST["adet"];$i++){
if($i%2==0){
echo'<div class="kutu">'.$i.'</div>';
}
else{
echo'<div class="kutu1">'.$i.'</div>';
}
}
}
?>
</body>
</html>