Menentukan Jumlah Apel dan Nanas
Scriptnya adalah sebagai berikut :
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Tugas Apel dan Nanas</title>
<style type="text/css">
#apel {
height: auto;
width: 100px;
vertical-align: middle;
background-color:;
}
#pineapple {
width: 100px;
background-color:;
}
#submit {
height: 50px;
width: 100px;
background-color:#5F04B4;
}
.body {
background-color:#190707;
font-family: "Forte", Monaco, monospace;
font-size: 14px;
text-align: center;
}
.body form table tr {
background-color:#5F04B4;
}
p.double {border-style: double;}
p.solid {border-style: solid;}
table tr td {
color:black;
background:#5F04B4;
}
</style>
<?php
$a= $_POST["apel"];
$b= $_POST["nanas"];
?>
</head>
<body class="body"><form action="" method="post">
<table width="300" height="227" border="5" align="center" class="solid">
<tr>
<td width="150" height="39" align="center" bgcolor="#FF0000" >Jumlah Apel</td>
<td height="39" align="center">Jumlah Nanas</td>
</tr>
<tr>
<td height="39" align="center" valign="middle"><label for="apel"></label>
<select name="apel" id="apel">
<option value="0">Apel</option>
<?php
for ($i=1; $i<=100; $i++)
{
?>
<option value="<?php echo $i;?>"><?php echo $i;?> </option>
<?php
}
?>
</select>
<td height="39" align="center" valign="middle"><label for="nanas"></label>
<select name="nanas" id="nanas">
<option value="0">Nanas</option>
<?php
for ($j=1; $j<=100; $j++)
{
?>
<option value="<?php echo $j;?>"><?php echo $j;?></option>
<?php
}
?>
</select></td>
</tr>
<tr>
<td height="20" width="20" align="center" valign="middle"><input type="submit" name="submit" id="Hitung" value="Hitung" /></td>
</tr>
</table>
</form>
<table width="auto" border="1" align="center" class="solid">
<tr>
<td width="200" height="auto" valign="top">
<?php
error_reporting(E_ALL ^ (E_NOTICE | E_WARNING));
for($m=0; $o<=$a; $o++)
{
echo " Ini Apel Ke- $o <br>" ;}
?>
</td>
<td width="200" height="auto" valign="top">
<?php for($m=0; $p<=$b; $p++)
{
echo " Ini Nanas Ke- $p <br>" ;
}
?>
</td>
</tr>
</table>
</body>
</html>
Outputnya :
Hasil dari output :
Scriptnya adalah sebagai berikut :
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Tugas Apel dan Nanas</title>
<style type="text/css">
#apel {
height: auto;
width: 100px;
vertical-align: middle;
background-color:;
}
#pineapple {
width: 100px;
background-color:;
}
#submit {
height: 50px;
width: 100px;
background-color:#5F04B4;
}
.body {
background-color:#190707;
font-family: "Forte", Monaco, monospace;
font-size: 14px;
text-align: center;
}
.body form table tr {
background-color:#5F04B4;
}
p.double {border-style: double;}
p.solid {border-style: solid;}
table tr td {
color:black;
background:#5F04B4;
}
</style>
<?php
$a= $_POST["apel"];
$b= $_POST["nanas"];
?>
</head>
<body class="body"><form action="" method="post">
<table width="300" height="227" border="5" align="center" class="solid">
<tr>
<td width="150" height="39" align="center" bgcolor="#FF0000" >Jumlah Apel</td>
<td height="39" align="center">Jumlah Nanas</td>
</tr>
<tr>
<td height="39" align="center" valign="middle"><label for="apel"></label>
<select name="apel" id="apel">
<option value="0">Apel</option>
<?php
for ($i=1; $i<=100; $i++)
{
?>
<option value="<?php echo $i;?>"><?php echo $i;?> </option>
<?php
}
?>
</select>
<td height="39" align="center" valign="middle"><label for="nanas"></label>
<select name="nanas" id="nanas">
<option value="0">Nanas</option>
<?php
for ($j=1; $j<=100; $j++)
{
?>
<option value="<?php echo $j;?>"><?php echo $j;?></option>
<?php
}
?>
</select></td>
</tr>
<tr>
<td height="20" width="20" align="center" valign="middle"><input type="submit" name="submit" id="Hitung" value="Hitung" /></td>
</tr>
</table>
</form>
<table width="auto" border="1" align="center" class="solid">
<tr>
<td width="200" height="auto" valign="top">
<?php
error_reporting(E_ALL ^ (E_NOTICE | E_WARNING));
for($m=0; $o<=$a; $o++)
{
echo " Ini Apel Ke- $o <br>" ;}
?>
</td>
<td width="200" height="auto" valign="top">
<?php for($m=0; $p<=$b; $p++)
{
echo " Ini Nanas Ke- $p <br>" ;
}
?>
</td>
</tr>
</table>
</body>
</html>
Outputnya :
Hasil dari output :
0 komentar:
Posting Komentar