Monggo di klik link di bawah ini untuk mengetahui bisnis online ini lebih lanjut
http://www.penasaran.net/?ref=rpwzdh
Blog ini tempat saya berbagi ilmu. Baik ilmu yang saya dapat sewaktu di Internet, Teman, SMAK Kolese Santo Yusup Malang, maupun di prodi Sistem Informasi Universitas Machung
Minggu, 04 September 2011
Senin, 07 Maret 2011
Revisi Latihan Ujian Praktek
masuk.php
<html>
<head>
<style type=text/css>
B {color:blue; font-style:italic;text-decoration:line-through}
</style>
</head>
<body>
<B>Penjualan Pernak Pernik Online</B>
<pre>
<form method=post action=jadi.php>
Nama : <input type=text name=nama>
Email : <input type=text name=email>
Hadiah : <input type=radio name=hadiah value=Boneka>Boneka
<input type=radio name=hadiah value=Bunga >Bunga
<input type=radio name=hadiah value=Baju >Baju
<input type=radio name=hadiah value=Pita >Pita
Warna : <select name=warna>
<?php
$d=array(5=>"Biru","Kuning","Merah","Hitam","Putih");
for($x=5;$x<=9;$x++)
{
echo "<option value=$d[$x]>$d[$x]";
}
?>
</select>
<input type=submit value=Pesan>
</form>
<form method=post action=search.php>
<input type=text name=nama>
<input type=submit value=search>
</form>
</pre>
</body>
</html>
<!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=utf-8" />
<title>Untitled Document</title>
</head>
<?php
$nama =$_POST['nama'];
$email =$_POST['email'];
$hadiah =$_POST['hadiah'];
$warna =$_POST['warna'];
mysql_connect("localhost","root","");
mysql_select_db("db12a3_19") or die("Database Not Found");
$hsl=mysql_query("insert into coba(nama,email,hadiah,warna) values ('$nama','$email','$hadiah','$warna')");
$d=mysql_query("select * from coba where hadiah='Boneka'");
$bo=mysql_num_rows($d);
$d=mysql_query("select * from coba where hadiah='Bunga'");
$bu=mysql_num_rows($d);
$d=mysql_query("select * from coba where hadiah='Baju'");
$ba=mysql_num_rows($d);
$d=mysql_query("select * from coba where hadiah='Pita'");
$pi=mysql_num_rows($d);
$tot=$bo+$bu+$ba+$pi;
$hsl=mysql_query("select * from coba");
while($d=mysql_fetch_array($hsl))
{
echo "<pre>";
echo "Nama : $d[nama] <br>";
echo "Email : $d[email] <br>";
echo "Hadiah : $d[hadiah] <br>";
echo "Warna : $d[warna] <br>";
}
echo "Banyak orang yang suka Boneka : ". $bo/$tot*100 ."%<br>";
echo "Banyak orang yang suka Bunga : ". $bu/$tot*100 ."%<br>";
echo "Banyak orang yang suka Baju : ". $ba/$tot*100 ."%<br>";
echo "Banyak orang yang suka Pita : ". $pi/$tot*100 ."%<br>";
?>
<body>
</body>
</html>
search.php
<!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=utf-8" />
<title>Untitled Document</title>
</head>
<?php
$nama=$_POST['nama'];
mysql_connect("localhost","root","");
mysql_select_db("db12a3_19") or die("Database Not Found");
$hasil=mysql_query("select * from coba where nama like '%$nama%'");
while($d=mysql_fetch_array($hasil))
{
echo "Nama : $d[nama] <br>";
echo "Email : $d[email] <br>";
echo "Hadiah : $d[hadiah] <br>";
echo "Warna : $d[warna] <br>";
}
?>
<body>
</body>
</html>
Rek, nie filenya memang bisa disingkat jd 2 file doank tp lbh njelimet yg mw tau hub q ajh...
<html>
<head>
<style type=text/css>
B {color:blue; font-style:italic;text-decoration:line-through}
</style>
</head>
<body>
<B>Penjualan Pernak Pernik Online</B>
<pre>
<form method=post action=jadi.php>
Nama : <input type=text name=nama>
Email : <input type=text name=email>
Hadiah : <input type=radio name=hadiah value=Boneka>Boneka
<input type=radio name=hadiah value=Bunga >Bunga
<input type=radio name=hadiah value=Baju >Baju
<input type=radio name=hadiah value=Pita >Pita
Warna : <select name=warna>
<?php
$d=array(5=>"Biru","Kuning","Merah","Hitam","Putih");
for($x=5;$x<=9;$x++)
{
echo "<option value=$d[$x]>$d[$x]";
}
?>
</select>
<input type=submit value=Pesan>
</form>
<form method=post action=search.php>
<input type=text name=nama>
<input type=submit value=search>
</form>
</pre>
</body>
</html>
jadi.php
<!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=utf-8" />
<title>Untitled Document</title>
</head>
<?php
$nama =$_POST['nama'];
$email =$_POST['email'];
$hadiah =$_POST['hadiah'];
$warna =$_POST['warna'];
mysql_connect("localhost","root","");
mysql_select_db("db12a3_19") or die("Database Not Found");
$hsl=mysql_query("insert into coba(nama,email,hadiah,warna) values ('$nama','$email','$hadiah','$warna')");
$d=mysql_query("select * from coba where hadiah='Boneka'");
$bo=mysql_num_rows($d);
$d=mysql_query("select * from coba where hadiah='Bunga'");
$bu=mysql_num_rows($d);
$d=mysql_query("select * from coba where hadiah='Baju'");
$ba=mysql_num_rows($d);
$d=mysql_query("select * from coba where hadiah='Pita'");
$pi=mysql_num_rows($d);
$tot=$bo+$bu+$ba+$pi;
$hsl=mysql_query("select * from coba");
while($d=mysql_fetch_array($hsl))
{
echo "<pre>";
echo "Nama : $d[nama] <br>";
echo "Email : $d[email] <br>";
echo "Hadiah : $d[hadiah] <br>";
echo "Warna : $d[warna] <br>";
}
echo "Banyak orang yang suka Boneka : ". $bo/$tot*100 ."%<br>";
echo "Banyak orang yang suka Bunga : ". $bu/$tot*100 ."%<br>";
echo "Banyak orang yang suka Baju : ". $ba/$tot*100 ."%<br>";
echo "Banyak orang yang suka Pita : ". $pi/$tot*100 ."%<br>";
?>
<body>
</body>
</html>
search.php
<!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=utf-8" />
<title>Untitled Document</title>
</head>
<?php
$nama=$_POST['nama'];
mysql_connect("localhost","root","");
mysql_select_db("db12a3_19") or die("Database Not Found");
$hasil=mysql_query("select * from coba where nama like '%$nama%'");
while($d=mysql_fetch_array($hasil))
{
echo "Nama : $d[nama] <br>";
echo "Email : $d[email] <br>";
echo "Hadiah : $d[hadiah] <br>";
echo "Warna : $d[warna] <br>";
}
?>
<body>
</body>
</html>
Rek, nie filenya memang bisa disingkat jd 2 file doank tp lbh njelimet yg mw tau hub q ajh...
Rabu, 02 Maret 2011
Latihan Ujian Praktek Komputer
mysql -h 192.168.0.64 -u 12ax-yy -p
use db12a3_yy;
create table coba(id int(50), nama varchar(50), email varchar(255), hadiah varchar(50), warna varchar(50), primary key(id));
use db12a3_yy;
create table coba(id int(50), nama varchar(50), email varchar(255), hadiah varchar(50), warna varchar(50), primary key(id));
masuk.php
<html>
<head>
<style type=text/css>
B {color:blue; font-style:italic;text- decoration:line-through}
</style>
</head>
<html>
<head>
<style type=text/css>
B {color:blue; font-style:italic;text-
</style>
</head>
<body>
<B>Penjualan Pernak Pernik Online</B>
<pre>
<form method=post action=jadi.php>
Nama : <input type=text name=nama>
Email : <input type=text name=nama>
Hadiah : <input type=radio name=hadiah value=Boneka>Boneka
<input type=radio name=hadiah value=Bunga >Bunga
<input type=radio name=hadiah value=Baju >Baju
<input type=radio name=hadiah value=Pita >Pita
Warna : <select name=warna>
<pre>
<form method=post action=jadi.php>
Nama : <input type=text name=nama>
Email : <input type=text name=nama>
Hadiah : <input type=radio name=hadiah value=Boneka>Boneka
<input type=radio name=hadiah value=Bunga >Bunga
<input type=radio name=hadiah value=Baju >Baju
<input type=radio name=hadiah value=Pita >Pita
Warna : <select name=warna>
<?
$d=array(5=>"Biru","Kuning", "Merah","Hitam","Putih");
$d=array(5=>"Biru","Kuning",
for($x=5;$x<=8;$x++)
{
echo "<option value=$d[$x]>$d[$x]";
}
?>
</select>
{
echo "<option value=$d[$x]>$d[$x]";
}
?>
</select>
<input type=submit value=Pesan>
</form>
<form method=post action=search.php>
<input type=text name=nama>
<input type=submit value=search>
</form>
</form>
<form method=post action=search.php>
<input type=text name=nama>
<input type=submit value=search>
</form>
</pre>
</body>
</html>
</body>
</html>
jadi.php
<?
$nama =$_POST['nama'];
$email =$_POST['email'];
$hadiah =$_POST['hadiah'];
$warna =$_POST['warna'];
mysql_connect("192.168.0.64"," 12ax-yy","1234");
mysql_select_db("db12a3_yy") or die("Database Not Found");
$hsl=mysql_query("insert into coba(nama,email,hadiah,warna) values ('$nama','$email','$hadiah','$ warna')");
mysql_select_db("db12a3_yy") or die("Database Not Found");
$hsl=mysql_query("insert into coba(nama,email,hadiah,warna) values ('$nama','$email','$hadiah','$
$d=mysql_query("select * from coba where hadiah='Boneka'");
$bo=mysql_num_rows($hsl);
$d=mysql_query("select * from coba where hadiah='Bunga'");
$bu=mysql_num_rows($hsl);
$d=mysql_query("select * from coba where hadiah='Baju'");
$ba=mysql_num_rows($hsl);
$d=mysql_query("select * from coba where hadiah='Pita'");
$pi=mysql_num_rows($hsl);
$bo=mysql_num_rows($hsl);
$d=mysql_query("select * from coba where hadiah='Bunga'");
$bu=mysql_num_rows($hsl);
$d=mysql_query("select * from coba where hadiah='Baju'");
$ba=mysql_num_rows($hsl);
$d=mysql_query("select * from coba where hadiah='Pita'");
$pi=mysql_num_rows($hsl);
$tot=$bo+$bu+$ba+$pi;
$hsl=mysql_query("select * from coba");
while($d=mysql_fetch_array($ hsl))
{
echo "<pre>";
echo "Nama : $d[nama] <br>";
echo "Email : $d[email] <br>";
echo "Hadiah : $d[hadiah] <br>";
echo "Warna : $d[warna] <br>";
}
$hsl=mysql_query("select * from coba");
while($d=mysql_fetch_array($
{
echo "<pre>";
echo "Nama : $d[nama] <br>";
echo "Email : $d[email] <br>";
echo "Hadiah : $d[hadiah] <br>";
echo "Warna : $d[warna] <br>";
}
echo "Banyak orang yang suka Boneka :".$bo/$tot*100"%<br>";
echo "Banyak orang yang suka Bunga :".$bu/$tot*100"%<br>";
echo "Banyak orang yang suka Baju :".$ba/$tot*100"%<br>";
echo "Banyak orang yang suka Pita :".$pi/$tot*100"%<br>";
?>
echo "Banyak orang yang suka Bunga :".$bu/$tot*100"%<br>";
echo "Banyak orang yang suka Baju :".$ba/$tot*100"%<br>";
echo "Banyak orang yang suka Pita :".$pi/$tot*100"%<br>";
?>
search.php
<?
$nama=$_POST['nama'];
mysql_connect("192.168.0.64"," 12ax-yy","1234");
mysql_select_db("db12a3_yy") or die("Database Not Found");
<?
$nama=$_POST['nama'];
mysql_connect("192.168.0.64","
mysql_select_db("db12a3_yy") or die("Database Not Found");
$hasil=mysql_query("select * from coba where nama like '%$nama%'");
while($d=mysql_fetch_array($ hasil))
{
echo "Email : $d[email] <br>";
echo "Hadiah : $d[hadiah] <br>";
echo "Warna : $d[warna] <br>";
}
?>
while($d=mysql_fetch_array($
{
echo "Email : $d[email] <br>";
echo "Hadiah : $d[hadiah] <br>";
echo "Warna : $d[warna] <br>";
}
?>
Sabtu, 19 Februari 2011
Yang Lagi dicari
TENTANG DATABASE
mysql -h 192.168.0.64 -u 12ax-yy -p
1234
use db12ax_yy;
create table buku(id char(3) not null auto_increment, nama varchar(20), jeniskel set('L','P'), buku varchar(10), jumlah int(2), bayar int(8), primary key(id));
insert into buku(nama, jeniskel, buku, jumlah, bayar) values('Dunu','L','Komik','10','56000'), ('Fenny','P','Novel','30','47000'), ('Verena','P','Pelajaran','1','3800');
a. select nama,jumlah from buku order by jumlah desc;
b. update buku set nama='Reni' where nama='Fenny';
c. insert into buku(nama,jeniskel,jumlah,bayar) values('Tompel','L',Komik','10','25000');
d. select id,nama where buku='Pelajaran';
e. select buku,bayar from buku;
delete from buku where bayar<10000;
TENTANG POLLING
<body>
<pre>
<form method=post action=inputaxyy.php>
Nama : <input type=text name=nama>
Kelas : <select name=kelas>
<option value=12 IPA 1>12 IPA 1
<option value=12 IPA 2>12 IPA 2
<option value=12 IPA 3>12 IPA 3
<option value=12 IPA 4>12 IPA 4
<option value=12 IPA 5>12 IPA 5
</select>
Rasa ice cream apakah yang paling anda gemari ?
<input type=radio name=rasa value=coklat>coklat
<input type=radio name=rasa value=strawberry>strawberry
<input type=radio name=rasa value=vanila>vanila
<input type=radio name=rasa value=mocca>mocca
<input type=submit value=Polling>
</form>
</pre>
</body>
</html>
$nama=$_POST['nama'];
$kelas=$_POST['kelas'];
$rasa=$_POST['rasa'];
mysql_connect("192.168.0.64","12ax-yy","1234");
mysql_select_db("db12ax_yy") or die ("Database tidak ada");
$hasil=mysql_query("insert into ice(nama,kelas,rasa) values('$nama','$kelas','$rasa')");
echo"<a href=hasilpollingaxyy.php>LIHAT HASIL POLLING</a>";
?>
hasilpollingaxyy.php
<?
mysql_connect("192.168.0.64","12ax-yy","1234");
mysql_select_db("db12ax_yy") or die ("Database tidak ada");
$hsl=mysql_query("select from ice where rasa=coklat");
$co=mysql_num_rows($hsl);
$hsl=mysql_query("select from ice where rasa=strawberry");
$sb=mysql_num_rows($hsl);
$hsl=mysql_query("select from ice where rasa=vanila");
$va=mysql_num_rows($hsl);
$hsl=mysql_query("select from ice where rasa=mocca");
$mo=mysql_num_rows($hsl);
$t=$co+$sb+$va+$mo;
echo"Rasa es cream apakah yang paling anda sukai ?<br>";
echo"Hasil Polling :<br>";
$p1=$co/$t*100;
$p2=$sb/$t*100;
$p3=$va/$t*100;
$p4=$mo/$t*100;
echo"Coklat : <img src=blue.jpg width=$p1 height=10>" .$p1. "%<br>";
echo"Strawberry : <img src=green.jpg width=$p2 height=10>" .$p2. "%<br>";
echo"Vanila : <img src=lightblue.jpg width=$p3 height=10>" .$p3. "%<br>";
echo"Mocca : <img src=red.jpg width=$p4 height=10>" .$p4. "%<br>";
echo"<a href=pollinga319.htm>Kembali ke halaman utama</a>";
?>
mysql -h 192.168.0.64 -u 12ax-yy -p
1234
use db12ax_yy;
create table buku(id char(3) not null auto_increment, nama varchar(20), jeniskel set('L','P'), buku varchar(10), jumlah int(2), bayar int(8), primary key(id));
insert into buku(nama, jeniskel, buku, jumlah, bayar) values('Dunu','L','Komik','10','56000'), ('Fenny','P','Novel','30','47000'), ('Verena','P','Pelajaran','1','3800');
a. select nama,jumlah from buku order by jumlah desc;
b. update buku set nama='Reni' where nama='Fenny';
c. insert into buku(nama,jeniskel,jumlah,bayar) values('Tompel','L',Komik','10','25000');
d. select id,nama where buku='Pelajaran';
e. select buku,bayar from buku;
delete from buku where bayar<10000;
TENTANG POLLING
pollingaxyy.htm
<html><body>
<pre>
<form method=post action=inputaxyy.php>
Nama : <input type=text name=nama>
Kelas : <select name=kelas>
<option value=12 IPA 1>12 IPA 1
<option value=12 IPA 2>12 IPA 2
<option value=12 IPA 3>12 IPA 3
<option value=12 IPA 4>12 IPA 4
<option value=12 IPA 5>12 IPA 5
</select>
Rasa ice cream apakah yang paling anda gemari ?
<input type=radio name=rasa value=coklat>coklat
<input type=radio name=rasa value=strawberry>strawberry
<input type=radio name=rasa value=vanila>vanila
<input type=radio name=rasa value=mocca>mocca
<input type=submit value=Polling>
</form>
</pre>
</body>
</html>
inputaxyy.php
<?$nama=$_POST['nama'];
$kelas=$_POST['kelas'];
$rasa=$_POST['rasa'];
mysql_connect("192.168.0.64","12ax-yy","1234");
mysql_select_db("db12ax_yy") or die ("Database tidak ada");
$hasil=mysql_query("insert into ice(nama,kelas,rasa) values('$nama','$kelas','$rasa')");
echo"<a href=hasilpollingaxyy.php>LIHAT HASIL POLLING</a>";
?>
hasilpollingaxyy.php
<?
mysql_connect("192.168.0.64","12ax-yy","1234");
mysql_select_db("db12ax_yy") or die ("Database tidak ada");
$hsl=mysql_query("select from ice where rasa=coklat");
$co=mysql_num_rows($hsl);
$hsl=mysql_query("select from ice where rasa=strawberry");
$sb=mysql_num_rows($hsl);
$hsl=mysql_query("select from ice where rasa=vanila");
$va=mysql_num_rows($hsl);
$hsl=mysql_query("select from ice where rasa=mocca");
$mo=mysql_num_rows($hsl);
$t=$co+$sb+$va+$mo;
echo"Rasa es cream apakah yang paling anda sukai ?<br>";
echo"Hasil Polling :<br>";
$p1=$co/$t*100;
$p2=$sb/$t*100;
$p3=$va/$t*100;
$p4=$mo/$t*100;
echo"Coklat : <img src=blue.jpg width=$p1 height=10>" .$p1. "%<br>";
echo"Strawberry : <img src=green.jpg width=$p2 height=10>" .$p2. "%<br>";
echo"Vanila : <img src=lightblue.jpg width=$p3 height=10>" .$p3. "%<br>";
echo"Mocca : <img src=red.jpg width=$p4 height=10>" .$p4. "%<br>";
echo"<a href=pollinga319.htm>Kembali ke halaman utama</a>";
?>