1. input _siswa.php
<form name="form1" method="POST" action="simpan_siswa.php">
<table width="400" border="0" align="center" cellpadding="1" cellspacing="1"
bordercolor="#00FF00" bgcolor="#33CC00">
<tr bgcolor="#CCFFCC">
<td height="50" colspan="2"><div align="center">INPUT DATA SISWA </div></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="40">Nis </td>
<td>:
<input name="nis" type="text" id="nis"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="40">Nama </td>
<td>:
<input name="nama" type="text" id="nama"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td> </td>
<td height="50"><input type="submit" name="Submit" value="Simpan"></td>
</tr>
</table>
</form>
<form name="form1" method="POST" action="simpan_siswa.php">
<table width="400" border="0" align="center" cellpadding="1" cellspacing="1"
bordercolor="#00FF00" bgcolor="#33CC00">
<tr bgcolor="#CCFFCC">
<td height="50" colspan="2"><div align="center">INPUT DATA SISWA </div></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="40">Nis </td>
<td>:
<input name="nis" type="text" id="nis"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="40">Nama </td>
<td>:
<input name="nama" type="text" id="nama"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td> </td>
<td height="50"><input type="submit" name="Submit" value="Simpan"></td>
</tr>
</table>
</form>
2. Simpan_siswa.php
<?php
include ("koneksi.php");
$nis=$_POST['nis'];
$nama=$_POST['nama'];
$simpan="insert into siswa values('$nis','$nama')";
mysql_query($simpan);
echo "data berhasil disimpan ";
include ("tampil_siswa.php");
echo "<br>";
echo "<a href=input_siswa.php>back</a>";
?>
Komentar
Posting Komentar