This is default featured slide 1 title

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

This is default featured slide 2 title

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

This is default featured slide 3 title

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

This is default featured slide 4 title

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

This is default featured slide 5 title

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

Minggu, 26 Februari 2012

MENGOLAH DATA DENGAN PHP

Kali ini saya akan mengolah data dengan PHP.yang mana data basenya menggunakan data base yang pernah diposting sebelumnya.untuk merefresh kembali.

untuk bisa mengakses database dan tabel Mysql ,kita perlu melakukan koneksi terlebih dahulu.untuk mengaksesnya saya menggunakan dream weaver.
-Buka dream weaver.lalu ketik
<?
mysql_connect("localhost","root","");
mysql_select_db("bukutamu");
?>
-designlah tampilannya.

<html>
<head>
<title>Form Buku Tamu</title>
</head>
<body>
<h3 align=center>BUKU TAMU</h3>
<?php
$waktu = date("d F Y", mktime(0,0,0,date("m"),date("d"),date("Y")));
/*menghasilkan 27 February 2002*/
echo ("Tanggal : $waktu");
echo "<br>";
?>
<form name="form1" method="post" action="input_tamu.php">
  <table width="300" border="6" background="b.wmf">
    <tr>
      <td width="74">Nama</td>
      <td width="161"><input type="text" name="nama"></td>
    </tr>
    <tr>
      <td>Email</td>
      <td><input type="text" name="email"></td>
    </tr>
    <tr>
      <td>Pesan</td>
      <td><textarea name="pesan"></textarea></td>
    </tr>
    <tr>
      <td><input type="submit" name="Submit" value="kirim"></td>
      <td><input type="reset" name="reset" value="reset"></td>
    </tr>
  </table>
</form>

<p align=center>&nbsp;</p>
</body>
</html>
Lalu simpan di C/Xampp/htdoc beri nama form tamu
untuk koding inputnya
<?
include"koneksi_bukutamu.php";
$nama=$_POST["nama"];
$email=$_POST["email"];
$pesan=$_POST["pesan"];
$masuk="INSERT INTO tamu(nama,email,pesan)VALUES('$nama','$email','$pesan')";
$hasil=mysql_query($masuk);
//apabila input data berhasil
if($hasil)
{
echo"Ok bro....Proses Input Data Lw SUKSES";
}
else
{
echo"Maaf bro....Proses Input Data lw GAGAL..Silahkan coba lagi";
}
?>
  Lalu simpan di C/Xampp/htdoc beri nama input tamu
 Panggil yang telah kita simpan tadi di browser anda(Opera,Modzilla,Internet explorer)
ketik disearch http://localhost/nama file disini saya beri nama formtamu lalu enter
maka akan tampil
 
-Isilah kolom tersebut lalu klik kirim
maka akan tampil :
 
maka secara otomatis akan tersimpan di data base