0% found this document useful (0 votes)
215 views4 pages

Latihan Uts Web Programming

The document provides instructions for creating two web form programs in PHP. The first form is for concert tickets and includes fields for studio, class type, and calculates total price based on selections. The second form is for a paint store transaction, including fields for paint type and quantity, calculates total price and applies volume discounts, and displays final payment amount. Students are to save the form code in .php files and test them by running on a local server.

Uploaded by

RudiDudiRudi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
215 views4 pages

Latihan Uts Web Programming

The document provides instructions for creating two web form programs in PHP. The first form is for concert tickets and includes fields for studio, class type, and calculates total price based on selections. The second form is for a paint store transaction, including fields for paint type and quantity, calculates total price and applies volume discounts, and displays final payment amount. Students are to save the form code in .php files and test them by running on a local server.

Uploaded by

RudiDudiRudi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

1

LATIHAN UTS WEB PROGRAMMING


Contoh: Rancanglah program web untuk membuat form data pegawai sebagai berikut:
Tampilan Input Tampilan Output


Data.php



pegawai.php

Langkah kerja:
1. Install Xampp ke dalam komputer
2. Hidupkan apache, filezila dan mysql
3. Editlah script dibawah ini pada notepad
<head>
<title> bagian input data</title>
</head>
<body>
<form action="pegawai.php" method="POST">
<h1><font color="black"><font="Arial"> Formulir Pegawai Negeri Konoha
</font></h1>
<table border="1" width="400" align="left" cellspacing="1">
<tr>
<td colspan="2" align="left" ><b>Isi Data Di Bawah ini :</b></td>
</tr>
<tr>
<td width="150"><b> Nama </b></td>
<td><b><input type="text" name="nama" width="100"></b></td>
</tr>
<tr>
<td><b> Alamat </b></td>
<td><b><textarea name="alamat" rows="4" cols="20"></textarea></b></td>
<tr>
<td><b> Tempat Lahir </b></td>
<td><b><input type="text" name="tl"></b></td>
<tr>
<td><b> Tanggal Lahir </b></td>
<td><b><input type="text" name="tanggal"></b></td>
<tr>
<td><b>Jenis Kelamin </b></td>
<td><b><input type="radio" name="jekel" value="Laki-Laki">Laki-Laki
<input type="radio" name="jekel" value="Perempuan">Perempuan</b></td>
<tr>
<td><b> Pendidikan </b></td>
<td><b><select name="pend">


2

<option>==>Pilih<==</option>
<option>S1</option>
<option>D3</option>
<option>D1</option>
<option>SMU</option>
</td>
<tr>
<td border="0" align="center" colspan="2">
<input type="submit" value="Click Here"><input type="reset" value="Cancel">
</tr></td>
</table>
4. Save file dengan nama: data.php kedalam sub folder c:program files/xampp/htdocs/
5. Ketik http://localhost/data.php dan jalankan pada browser , isi datanya sehingga nampak tampilan
input seperti di atas
6. Lalu editlah script di bawah ini dan simpan dengan nama: pegawai.php, lakukan langkah 3 sd 5 dan
jalankan sehingga tampak hasilnya seperti di atas:

<html>
<head>
<title> bagian output data</title>
</head>
<body>
<?PHP
$nm=$_POST['nama'];
$al=$_POST['alamat'];
$ttl=$_POST['tl'];
$tl=$_POST['tanggal'];
$jk=$_POST['jekel'];
$p=$_POST['pend'];
echo"<h1><font color=black font=Arial>FORMULIR PEGAWAI NEGERI KONOHA
</font></h1>";
echo"<br>";
echo"<table border=0 >";
echo"<tr><td>";
echo"<table border=2 width=400 align=left cellspacing=1><tr>";
echo"<tr><td>Nama :</td><td>$nm</td></tr>";
echo"<tr><td>Alamat :</td><td>$al</td></tr>";
echo"<tr><td>Tempat Lahir :</td><td>$ttl</td></tr>";
echo"<tr><td>Tanggal Lahir:</td><td>$tl</td></tr>"; echo"<tr><td>Jenis
Kelamin:</td><td>$jk</td></tr>"; echo"<tr><td>Pendidikan
:</td><td>$p</td></tr>"; echo"</table></tr></td>";
echo"<tr><td align='center'><a href='c.php'>Back To Home</tr></td></table>";
?>
</body>
</html>





















3

SOAL1: Rancanglah program web untuk membuat form tiket konser sebagai berikut:

Tampilan Input Tampilan Output

Tiket Konser Amal Indahnya berbagi


Tiket Konser Amal Indahnya Berbagi




Ketentuan Soal :
a. Jika STUDIO 1 maka bintang tamu Opick Jika STUDIO 2 maka bintang tamu Raihan
b. Jika Jenis kelas VIP maka harga 500000
c. Selain itu kelas FESTIVAL maka harga 250000
d. Hitung Total Harga
e. Jika klik Back to Home akan kembali ke halaman 1

Soal 2: Rancanglah program web untuk membuat form struk belanja toko cat sebagai berikut:

Tampilan Input Tampilan Output








Ketentuan Soal:

a. Jenis Cat :


MOWILEX maka Harga = 20000


DANAPAINT maka Harga = 30000



CATYLAC maka Harga = 40000



4




b. Total Harga = Harga * Jumlah Beli






c. Diskon: Jika Jumlah Beli >= 5 maka diskon 5% dari Total Harga Jika Jumlah Beli >= 10 maka diskon


10% dari Total Harga Selain itu diskon=0



d. Total Bayar = Total Harga Diskon



e. Jika di Klik Kembali maka akan tampil Form cat.php

You might also like