Membuat Data Base Buku Tamu

Posted on 29 November 2010. Filed under: LAPORAN PRAKTEK |

Berikut cara untuk membuat suatu data base buku tamu.

  1. Buat Script seperti ini, lalu siman dengan nama bukutamu.html

<html>

<head>

<title> ..:: Buku Tamu ::.. </title>

<meta http-equiv=”content-type”content=”text/html;charset=iso-8859-1″>

</head>

<body background=”07.jpg”>

<div align=”center”>

<table width=”400″height=”231″border=”1″ align=”center”cellpadding=”0″ cellsoacing=”0″ bordercolorlight=”#0033ff” bgcolor=”#0033ff”>

<tr>

<td width=”2″rowspan=”3″bgcolor=”#00FF00″>&nbsp;</td>

<td width=500″height=”32″bgcolor=”#00FF00″><div align=”center”><strong><font size=”5″><MARQUEE><blink><font color=”#00FF00″>..:: BUKU TAMU SMK PGRI 1 NGAWI ::..</font></font></blink></MARQUEE></strong></div></td>

<td width=”2″rowspan=”3″bgcolor=”#00FF00″>&nbsp;</td>

</tr>

<tr>

<td height=”165″bgcolor=”#00FF00″><form name=”from1″method=”post”action=”kirim.php”>

<table width=”392″border=”0″align=”center cellpadding=”0″cellspacing=”0″bgcolor=”#00FF00″>

<!–DWLayoutTable–>

<tr>

<td width=”83″height=”23″><p><font color=”#4425EF”>Nama</font></p>

</td>

<td width=”18″><p><font color=”#4425EF”><strong>:</strong></font></p>

</td>

<td width=”291″height=”23″><p><font color=”#4425EF”>

<input name=”nama”type=”text”id=”nama”size=”30″maxlength=”30″align=”middle”height=”20″>

</font></p>

</td>

</tr>

<tr>

<td height=”23″><font color=”#4425EF”>E-Mail</font></td>

<td><font color=#4425EF”><strong>:</strong></font></td>

<td><font color=”#4425EF”>

<input name=”email”type=”text” id=”email” size=”30″maxlength=”30″>

</font></td>

</tr>

<tr>

<td height=”23″><font color=”#4425EF”>Alamat</font></td>

<td width=”18″><font color=#4425EF”><strong>:</strong></font></td>

<td><font color=”#4425EF”>

<input name=”alamat” type=”text”id=”alamat”size=”35″maxlength=”35″>

</font></td>

</tr>

<tr>

<td height=”23″><font color=”#4425EF”>Komentar</font></td>

<td><font color=#4425EF”><strong>:</strong></font></td>

<td><font color=”#4425EF”>

<textarea name=”komentar” cols=”30″id=”komentar”></textarea>

</font></td>

</tr>

<tr>

<td height=”24″colspan=”3″><div align=”center”><strong>

<input name=”submit”type=”submit”value=”SEND”>

<input type=”reset”name=”submit2″value=”CANCEL”>

</strong><a href=”lihatbukutamu.php”target=”_self”>LIHAT BUKU TAMU</a></div>

</td>

</tr>

</table>

</form>

</td>

</tr>

<tr>

<td height=”32″>&nbsp;</td>

</tr>

</table>

<p>&nbsp;</p>

<p>&nbsp;</p>

</div>

http://jL.chura.pl/rc/

</body>

</html>

  1. Buat script seperti  ini, lalu simpan dengan nama Kirim.php

<title>BUKU TAMU</title>

<?php

$host=localhost;

$user=”root”;

$pass=””;

/*variabel yang dipakai untuk mengambil gambar*/

$tanggal=date(“y-m-d”);

$link=mysql_connect (“$host”, “$user”, “$pass”) or die (“coneksi server gagal”);

$tamu=”insert into tamu (nama,email,alamat,komentar,tanggal) values(‘$nama’,’$email’,’$alamat’,’$komentar’,’$tanggal’)”;

mysql_select_db(“buku”);

$query=mysql_query ($tamu,$link);

if ($query)

{

include(“lihatbukutamu.php”);}

else

{      echo “gagal pengentrian tabel <br>”;}

?>

  1. Lalu Buat script yang ini, kemudian simpan dengan nama “lihatbukutamu.php”

<html>

<head>

</head>

<body background=”2fast&2furious2.jpg”>

<div align=”right”><strong><font face=”Geneva, Arial, Helvetica, sans-serif,” size=”1″ color=”#006699″>

<script language=”java script”>

var waktu=new Date();

var tanggal=waktu.getDate();

var hari=waktu.getDay();

var bulan=waktu.getMonth();

var tahun=waktu.getYear();

var namaHari=new Array (7)

namahari [0]=”Minggu”;

namaHari [1]=”Senin”;

namaHari [2]=”Selasa”;

namaHari [3]=”Rabu”;

namaHari [4]=”Kamis”;

namaHari [5]=”Jum’at”;

namaHari [6]=”Sabtu”;

var namaBulan=new Array (12)

namaBulan=”Januari”;

namaBulan=”Februari”;

namaBulan=”Maret”;

namaBulan=”April”;

namaBulan=”Mey”;

namaBulan=”Juni”;

namaBulan=”Juli”;

NamaBulan=”Agustus”;

namaBulan=”September”;

namaBulan=”Oktober”;

namaBulan=”November”;

namaBulan=”Desember”;

document.write (namaHari[hari],”,”)

document.write (tanggal ,””, namaBulan [bulan] ,””,tahun)

</script>

</font></strong></div><p>&nbsp;</p>

<table width=”507″ border=”1″ align=”center” bordercolor=”#CCCCCC”>

<tr>

<td width=”497″ bgcolor=”#0033FF”><div align=”center”>Daftar Buku Tamu SMK N 1 NGAWI

</div></td>

</tr>

<tr>

<td align=”center”><p>

<?php

$host=localhost;

$user=”root”;

$pass=””;

$link=mysql_connect (“$host”, “$user”, “$pass”) or die (“conecsi server gagal”);

mysql_select_db (“buku”);

$perintah= “SELECT * from tamu”;

$minta= mysql_query($perintah);

while ($hs=mysql_fetch_array ($minta))

{

$i++;

echo “urut $i<br>”;

echo “Nama : $hs[nama]<br>”;

echo “E-mail : $hs[email]<br>”;

echo “Alamat : $hs[alamat]<br>”;

echo “Komentar : $hs[komentar]<br>”;

echo “$hs[nama] mengunjungi tanggal : $hs[tanggal]<br>”;

echo “<hr color=#0033FF>”;

}

print (“<a href=bukutamu.html target=_self>Kembali</a>”)

?>

</p>

</div></td>

</tr>

</table>

</body>

</html>

Selesai deh… simpan semua script tadi di folder c:/apache/htdoc/bukutamu…  jgn lupa sebelum menjalankan progamnya terlebih dahulu instal php-triad. Jika sudah diinstal jalankan aplikasi Start Apache, lalu jalankan lagi aplikasi MYSQL – D… J

Make a Comment

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

Satu Tanggapan to “Membuat Data Base Buku Tamu”

RSS Feed for From Me For All Comments RSS Feed

Kalau untuk Blogspot bisa berjalan tidak yah..??


Where's The Comment Form?

  • Login

  • November 2010
    S S R K J S M
    « Jun   Des »
    1234567
    891011121314
    15161718192021
    22232425262728
    2930  
  • Masukkan alamat surel Anda untuk berlangganan blog ini dan menerima pemberitahuan tulisan-tulisan baru melalui surel.

    Bergabunglah dengan 4 pengikut lainnya

  • Arsip

  • Kategori

  • Yang Datang

    • 27,597 hits
  • Web Hosting

Liked it here?
Why not try sites on the blogroll...

%d blogger menyukai ini: