28 Ocak 2014 Salı

PHP-Kullanıcının girdiği satır ve sütun sayısına göre tablo oluşturan program




<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<meta name=”author” Content=”Cüneyt KORKUSUZ” />

<title>Tablo oluşturma</title>

</head>

 

<body>

<form id="form1" name="form1" method="post" action="">

  <table width="400" border="1" align="center">

    <tr>

      <td height="39" colspan="2" align="center"><strong>TABLO OLUŞTURMA</strong></td>

    </tr>

    <tr>

      <td height="39">SATIR SAYISI GIRINIZ=</td>

      <td><label for="kutu1"></label>

      <input type="text" name="kutu1" id="kutu1" /></td>

    </tr>

    <tr>

      <td height="43">SUTUN SAYISI GIRINIZ=</td>

      <td><label for="kutu2"></label>

      <input type="text" name="kutu2" id="kutu2" /></td>

    </tr>

    <tr>

      <td height="54" colspan="2" align="center"><input type="submit" name="button" id="button" value="TABLO OLUSTUR" /></td>

    </tr>

    <tr>

      <td height="54" colspan="2" align="center">

                

                 <?php

                 $satir=$_POST["kutu1"];

                 $sutun= $_POST["kutu2"];

                 echo "<table border=1 bordercolor=red>";

                

                 for($i=1;$i<$satir;$i++)

                 {

                                echo"<tr>";

                               

                                for($k=1;$k<$sutun;$k++)

                                {

                                              echo "<td>........</td>"; 

                                              }

                                                          

                                                           echo "</tr>"; 

                                             

                                              }

                

                                echo "</table>";

 

                 ?>

  

      </td>

    </tr>

  </table>

  <p>&nbsp;</p>

</form>

</body>

</html>

Hiç yorum yok :

Yorum Gönder

Yorumunuz uygun bulunduğu takdirde en kısa zamanda yayınlanacaktır.