Kode Program Pertama
<html>
<head>
<title>Membuat Tabel</title>
</head>
<body>
<form method="POST"name="formlat" action="hasil.php">
Baris <input type="text" name="baris" style="width:210px";><br>
Kolom <input type="text" name="kolom" style="width:210px";><br>
</font> <input type="submit" value="Periksa" name="submit"/>
<input type="reset" value="reset" name="reset"/>
</form>
</body>
</html>
OUTPUT
Kode Program ke dua
<html><head>
<title>TUGAS</title>
<link rel="stylesheet"href="my.css">
</head>
<body id="body">
<div id="header1">
<center><h1>TABEL HASIL</h1></center>
</div>
<?php
if(!isset($_POST['sumbit']))
{
$br=$_POST['baris'];
$kl=$_POST['kolom'];
echo "<table border=\"5\">";
for($i=1;$i<=$br;$i++)
{
echo "<tr>"."</tr>";
for($j=1;$j<=$kl;$j++)
{
echo "<td> Posisi Kolom ke-".$j."</td>";
}
}
echo "</table>";
}
?>
</div>
</body>
</html>
OUTPUT
:o :-s
ReplyDelete