CLICK HERE FOR BLOGGER TEMPLATES AND MYSPACE LAYOUTS »

Rabu, 27 Mei 2009

ISI PHP


&lthtml&gt
&lthead&gt
&lttitle&gtInput Data dari Form ke MySQL&lt/title&gt
&lt/head&gt

&ltbody&gt
&lt?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);


?&gt
Buku tamu - &lta href=lihat.php&gtlihat isi buku tamu&lt/a&gt&ltbr /&gt
&lt/body&gt
&lt/html&gt


0 comments: