This is default featured post 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured post 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured post 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured post 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured post 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Selasa, 01 November 2011

Cara Membuat Buku Tamu pada Web Program :


Buat terlebih dahulu database nya di phpMyAdmin,
Buat Database dengan nama : latihan_11080978
Buat table dengan nama : bk_tamu
Isi field” nya sbb :











Dan buat tampilan di macromedia dreamweafer tampilan sbb : 

Ubah textfield pada Nama = nm
Textfield E-mail = mail
Textfield Komentar = komen
Pada script klik di form yg telah dibuat : <form name =”form1” methode =”post” action =”simpan.php”>  
Isikan pada action dengan isian yg berwarna biru.
Sebelum membuat script untuk menyimpan inputan, kita buat file koneksi nya, berikut script untuk file koneksi :



Buat nama filenya : koneksi.php
<body>
<?
$hostname =”localhost”;
$username=”root”;
$password=”12345678”;
$dbname=”latihan_11080978”;
$koneksi=mysql_connect($hostname,$username,$password)or die (“ koneksi gagal”);
Mysql_select_db($dbname,$koneksi);
?>

Buat Script untuk penyimpanan dengan nama : simpan.php
<?
Include “koneksi.php”;
$nama=$_POST[“nm”];
$email=$_POST[“mail”];
$komentar=$_POST[“komen”];
$input=”insert into bk_tamu(nama,email,komentar)values(‘$nama’,’$email’,’$komentar’)”;
$query  =mysql_query($input)  ;
If ($query)
{
Echo “<pre>Nama          :$nama</pre>”:
Echo”<pre>email            :$email</pre>”:
Echo”<pre>komentar    :$komentar</pre>”;
}
Else
{
Echo “gagal tersimpan”;
Echo”<a href=input.php>[inputdata]</a>”;
}
?>