<?php header( "content-type: text/html; charset=UTF-8" ); if ($_POST["val"] != ""){ print "TEST 1-1<br>"; for ($i=1; $i<=$val; $i++){ for ($k=0; $k<$val; $k++){ if ($k < $i) print "*"; else print " "; } print "<br>"; } print "<br>TEST 1-2<br>"; for ($i=1; $i<=$val; $i++){ for ($k=$val; $k>=1; $k--){ if ($k <= $i) print "*"; else print " "; } print "<br>"; } print "<br>TEST 1-3<br>"; for ($i=1; $i<=$val; $i++){ for ($k=$val; $k>=1; $k--){ if ($k >= $i) print "*"; else print " "; } print "<br>"; } print "<br>TEST 1-4<br>"; for ($i=1; $i<=$val; $i++){ for ($k=1; $k<=$val; $k++){ if ($k >= $i) print "*"; else print " "; } print "<br>"; } } ?> <form name="form1" method="post" action=""> Input : <input type="text" name="val" size="5" > <input type="submit" name="Submit" value="OK" > </form>