Home » » Jawaban Tugas Web Pak Adam (untuk 7 Nov 2014)

Jawaban Tugas Web Pak Adam (untuk 7 Nov 2014)

1. Simpan coding dibawah dengan nama "kampus.php"

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Tugas Form</title>
</head>
<body bgcolor = "silver">
<h2>Masukan Data Anda</h2>
<table height = "40%">
<form method="post" action="save.php">

<tr>
<td>NIM</td>
<td>:</td>
<td><input type="text" name="nim"></td>
</tr>

<tr>
<td>Nama</td>
<td>:</td>
<td><input type="text" name="nama"></td>
</tr>

<tr>
<td>Jurusan</td>
<td>:</td>
<td><select name="jurusan">
<option value="Sistem Informasi">Sistem Informasi</option>
<option value="Teknik Informatika">Teknik Informatika</option>
<option value="Manajemen Informasi">Manajemen Informasi</option>
</select>
</td>
</tr>

<tr>
<td>Jenis Kelamin</td>
<td>:</td>
<td><input type="radio" name="jk" value = "laki-laki">Laki-laki
<input type="radio" name="jk" value = "Perempuan">Perempuan</td>
</tr>
<tr>
<td>Agama</td>
<td>:</td>
<td><select name="agama">
<option value="Islam">Islam</option>
<option value="Kristen">Kristen</option>
<option value="Hindhu">Hindhu</option>
<option value="Budha">Budha</option>
</select>
</td>
</tr>

<tr>
<td>Alamat</td>
<td>:</td>
<td><input type="text" name="alamat" size = 80></td>
</tr>
</table>
    <br />
<input type="submit" name="proses" value="Proses" /><input type="reset" name="bersih" value="Bersihkan" />
</form>
</body>
</html>


2. Simpan coding dibawah dengan nama "save.php"

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Untitled Page</title>
</head>
<body bgcolor = "green">
<?php

$nim = $_POST['nim'];
$nama = $_POST['nama'];
$jurusan = $_POST['jurusan'];
$jk = $_POST['jk'];
$agama = $_POST['agama'];
$alamat = $_POST['alamat'];
?>
<h2><font color = "yellow">Data Anda</h2>
<table width = "30%" border = 1>
<tr>
<td bgcolor = "leave green">NIM Anda</td>
<td><font color = "yellow"><?php echo "$nim"?></td>
</tr>
<tr>
<td bgcolor = "leave green">Nama Anda</td>
<td><font color = "yellow"><?php echo "$nama"?></td>
</tr>
<tr>
<td bgcolor = "leave green">Jurusan Anda</td>
<td><font color = "yellow"><?php echo "$jurusan"?></td>
</tr>
<tr>
<td bgcolor = "leave green">Jenis Kelamin</td>
<td><font color = "yellow"><?php echo "$jk"?></td>
</tr>
<tr>
<td bgcolor = "leave green">Agama</td>
<td><font color = "yellow"><?php echo "$agama"?></td>
</tr>
<tr>
<td bgcolor = "leave green">Alamat Anda</td>
<td><font color = "yellow"><?php echo "$alamat"?></td>
</tr>
</table>
</body>
</html>

Semoga Bermanfaat teman2!!!

1 komentar:

Posting Komentar