Tugas Pweb ASP

Daftar kelompok :

– Arsad dewantoro (11018130)

-Qusayri alhaitami D (11018145)

-Royan yunimiladi (11018160)

-Suharyadi (11018146)

-Angga ibnu barata (11018134)

-Giyono (11018156)

1. )  Form input menggunakan asp

<html>
<head>
<title>Form Input</title>
</head>
<body>
<body bgcolor=”00FFFF”></body>
<form method=”get” action=”simpleform.asp”>
<table>
<tr>
<td>Name</td><td><input type=”text” value=”” Name=”Name”></td>
</tr>
<tr>
<td>address</td><td><input type=”text” value=”” name=”address”></td>
</tr>
<tr>
<td>email</td><td><input type=”text” value=”” name=”email”><td>or website   </td><td><input type=”text” value=”” name=”email”></td>
</tr>
<tr>
<td>contact person</td><td><input type=”text” value=”” name=”contact person”></td>
</tr>
<tr>
<td>gender</td><td><input type=”radio” value=”L” name=”gender”>male</td>
<td><input type=”radio” value=”P” name=”gender”>female</td>
</tr>
<tr><td>
city <td><select name=”city”>
<option>yogyakarta</option>
<option>medan</option>
<option>semarang</option>
<option>bandung</option>
<option>jakarta</option>
<option>banda aceh</option>
<option>bandar lampung</option>
<option>dumai</option>
<option>langsa</option>
<option>dll</option></td>
</td></tr>
</select>
<tr><td>
question <td><textarea></textarea></td>
</td></tr>
</table>
<input type=”submit” value=”Save”>
<input type=”button” value=”cancel”>

</table>
</form>
</body>
</html>

2.) Perulangan For, while, dan do while dengan PHP

–>perulangan for

<html>

<body>

<?php
$n=0;
for($i=1; $i<=5; $i++)
{
$n=$n+$i;
}
echo “$n”;
?>
</body>
</html>

–>perulangan while
<html>
<body>
<?php
$x = 0;
while($x != 11)
{
echo $x;
$x++;
}
?>
</body>
</html>

–>Perulangan do while
<html>
<body>
<?php
$x = 0;
do
{
echo $x;
$x++;
}
while($x != 11)
?>
</html>
</body>

3.) php function

<?php

function add($x,$y)
{
$total=$x+$y;
return $total;
}
echo “150 + 150 = ” . add(150,150).”<br/>”;
function kurang($x,$y)
{
$total=$x-$y;
return $total;
}
echo “150 – 150 = ” . kurang(150,150).”<br/>”;
?>

Iklan

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google

You are commenting using your Google account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

Connecting to %s