Contoh :
Notepad ke 1
<html>
<head><title>form</title></head>
<body>
<form action="umi2.php" method=pos>
<h2 align=center><b>Input Data</b></h2>
<table align=center width=500>
<tr><td><b>Nama</td><td>:</td><td><body bgcolor=grey><input type=text name="NM" size=50><body bgcolor></b></td></tr>
<tr><td><b>Alamat</td><td>:</td><td><input type=text name="ALM"size=50></b></td></tr>
<tr><td><b>Gender</td><td>:</td><td>
<input type=radio name="GN" size=50 value="PRIA">Pria
<input type=radio name="GN" size=50 value="WANITA">Wanita
</td></tr>
<tr><td><b>Agama</td><td>:</td><td>
<select name="AGM">
<option value="ISLAM">Islam</option>
<option value="KRISTEN KATOLIK">Kristen Katolik</option>
<option value="KRISTEN PROTESTAN">Kristen Protestan</option>
<option value="HINDU">Hindu</option>
<option value="BUDHA">Budha</option>
<option value="KONGHUCU">Konghucu</option>
</select></td></tr>
<tr><td><b>Komentar</td><td>:</td><td>
<textarea name="KOM" rows=5 cols=40>Silakan di Isi</textarea></td></tr>
<tr><td></td><td></td><td></td></tr>
<tr><td></td><td></td><td>
<input type=submit name=KIRIM value=KIRIM>
<input type=reset name=BATAL value=BATAL></td></tr>
</form>
</body>
</html>
<html>
<head><title>form</title></head>
<body>
<?php
print "<h2 align=center><body bgcolor=grey><b>Hasil Data</b><body bgcolor></h2>";
echo ("
<table align=center>
<tr><td><b>Nama</td><td>:</td><td>$NM</b></td></tr>
<tr><td><b>Alamat</td><td>:</td><td>$ALM</b></td></tr>
<tr><td><b>Gender</td><td>:</td><td>$GN</b></td></tr>
<tr><td><b>Agama</td><td>:</td><td>$AGM</b></td></tr>
<tr><td><b>Komentar</td><td>:</td><td>$KOM</b></td></tr>
");
?>
<tr><td colspan=3><a href ="umi.php">Ulangi</a></td></tr>
</table>
</body>
</html>
Lalu, kita isi dengan data yang di inginkan.
Kemudian kita klik kirim. Dan tampilan akan seperti di bawah ini.
Tidak ada komentar:
Posting Komentar