Sponsor

Friday, 3 August 2012

contoh scrip masukan sim.php


Skrip masukansim.php
<html">
<body>
<?php
$koneksi=mysql_connect("localhost","root","password")or             die   ("Gagal   konek server".mysql_error());

if($koneksi){



mysql_select_db("buku",$koneksi)or                     die               ("Database                 gagal dibuka".mysql_error());


$txtid=$_POST['txtid'];
$txtnama=$_POST['txtnama'];
$txtalamat=$_POST['txtalamat'];
$rbgender=$_POST['rbgender'];


$sql="INSERT INTO anggota(id_anggota,nm_anggota,alamat,kelamin) VALUES('$txtid','$txtnama','$txtalamat','$rbgender')";
mysql_query($sql,$koneksi)or die("Gagal query disimpan".mysql_error());
echo"Data berhasil disimpan";
}
?>
</body>
</html>

No comments: