You are on page 1of 1

<?PHP if ($submit){ include "koneksi.

php"; $query = "INSERT INTO bukutamu(nama,alamat,email,komentar) VALUES ('$nama','$alamat','$email','$komentar')"; $hasil = mysql_query($query); if ($hasil){ echo "Input data sukses"; } else{ echo "Input data gagal"; } } else{ echo "<form method=post action=$PHP_SELF>"; echo "Nama : <input type=text name=nama><br>"; echo "Email : <input type=text name=email><br>"; echo "Alamat : <input type=text name=alamat><br>"; echo "Komentar : <textarea name=komentar></textarea><br>"; echo "<input type=submit name=submit value=Kirim> <input type=reset name=reset value=Hapus>"; echo "</form>"; } ?>

You might also like