<style type="text/css">
<!--
.style1 {font-size: 12px}
-->
</style>

<form method="post">
  <span>輸入矩形寬高(單位:■):寬:</span>
  <input name="width" type="text"  id="textfield" size="5" />
  <span>高:
  <input name="height" type="text"  id="textfield2" size="5" />
  </span>
  <input type="submit" name="button" id="button" value="顯示" />
</form>

<?
$height=isset($_POST['height'])?$_POST['height']:null;
$width=isset($_POST['width'])?$_POST['width']:null;
if ($height != null):
if ($height >= 1):
if ($width != null):
if ($width >= 1):
for ($i=1;$i<=$height;$i++){
    echo "<br>";
for ($j=1;$j<=$width;$j++){
    echo "■";
}
}
endif;
endif;
endif;
endif;
?>



範例網頁

arrow
arrow
    全站熱搜

    ALVIN 發表在 痞客邦 留言(0) 人氣()