CLICK HERE FOR BLOGGER TEMPLATES AND MYSPACE LAYOUTS »

Selasa, 10 Maret 2009




<html>
<head>
<title>Input Data dari Form ke MySQL</title>
</head>

<Body bgcolor='aqua'>
<body>
<?php
$nama = $_POST['nama'];
$pesan = $_POST['pesan'];
$conn = mysql_connect("localhost","root","");
if (!$conn) {
echo "Could not connect to db";
exit(1);
}
$db = mysql_select_db("latihan",$conn);

$sqlText = "insert into bukutamu(nama, pesan,tanggal)
values('$nama','$pesan',NOW(''))";
mysql_query($sqlText);


?>
<b>Buku Tamu -</b> <a href=lihat.php><b>Lihat Isi Buku Tamu</b></a><br />
</body>
</html>

0 komentar: