Tugas WebProgramming 2
Berikut script tampilan inputnya dan penjelasannya
script tampilan input
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style1 {
font-size: 24px;
font-weight: bold;
}
.style2 {
font-size: 14px;
font-weight: bold;
}
.style3 {font-size: 14px}
-->
</style>
</head>
<body>
<form id="form1" name="form1" method="post" action="konohaoutput.php">
<p class="style1">Formulir Pegawai Negeri Konoha</p>
<table width="373" border="1"> ---------------------------------"mengatur ketebalan tabel"
<tr>
<td colspan="2"><strong>Isi Data Dibawah Ini : </strong></td>
</tr>
<tr>
<td width="171"><strong>Nama</strong></td>
<td width="145"><input name="nama" type="text" id="nama" /></td>
</tr>
<tr>
<td><strong>Alamat</strong></td>
<td><textarea name="alamat" id="alamat"></textarea></td>
</tr>
<tr>
<td><strong>Tempat Lahir </strong></td>
<td><input name="tmptlahir" type="text" id="tmptlahir" /></td>
</tr>
<tr>
<td><strong>Tanggal Lahir </strong></td>
<td><input name="tgllahir" type="text" id="tgllahir" /></td>
</tr>
<tr>
<td><strong>Jenis Kelamin </strong></td>
<td><strong>
<input name="jeniskelamin" type="radio" value="laki-laki" />
<span class="style3"> Laki-Laki</span> </strong>
<span class="style2">
<input name="jeniskelamin" type="radio" value="perempuan" />
Perempuan</span></td>
</tr>
<tr>
<td><strong>Pendidikan</strong></td>
<td><select name="pendidikan" id="pendidikan">
<option>SMA</option>
<option>D3</option>
<option>S1</option>
<option>S3</option>
</select>
</td>
</tr>
<tr>
<td colspan="2">
<div align="center">
<input type="submit" name="Submit" value="Submit" />
<input type="reset" name="Submit2" value="Cancel" />
</div></td>
</tr>
</table>
<p class="style1"> </p>
</form>
</body>
</html>
Contoh tampilan outputnya dan scriptnya
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<p>FORMULIR PEGAWAI NEGERI KONOHA</p>
<?php
$nama=$_POST['nama'];
$alamat=$_POST['alamat'];
$tmptlahir=$_POST['tmptlahir'];
$tgllahir=$_POST['tgllahir'];
$jeniskelamin=$_POST['jeniskelamin'];
$pendidikan=$_POST['pendidikan'];
?>
<table width="358" border="1">
<tr>
<td width="170">Nama</td>
<td width="162"><?php echo $nama ?> </td>
</tr>
<tr>
<td>Alamat</td>
<td><?php echo $alamat ?> </td>
</tr>
<tr>
<td>Tempat Lahir </td>
<td><?php echo $tmptlahir ?> </td>
</tr>
<tr>
<td>Tanggal Lahir </td>
<td><?php echo $tgllahir ?> </td>
</tr>
<tr>
<td>Jenis Kelamin </td>
<td><?php echo $jeniskelamin ?> </td>
</tr>
<tr>
<td>Pendidikan</td>
<td><?php echo $pendidikan ?> </td>
</tr>
<tr>
<td colspan="2"><a href="konoha.php">Back To Home</a></td>
</tr>
</table>
<p> </p>
</form>
</body>
</html>
Tidak ada komentar:
Posting Komentar