Selasa, 03 Maret 2009

Isi PHP




<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: