Ane bingung perasaan kode ane udah bener. tp ada error
Spoiler for tkp:
http://s.kaskus.id/images/2016/01/04/7533866_20160104030613.png
ini isi kodenya
Spoiler for menu_tambahproses:
<?php
mysql_query("INSERT INTO menu set
judul = '$_POST[judul]',
link = '$_POST[link]',
urutan = '$_POST[urutan]'
") or die(mysql_error());
echo"Data telah tersimpan";
echo"<meta http-equiv='refresh'
content='1; url=?tampil=menu_'>";
?>
Spoiler for menu_tambah.php:
<h2>Tambah Menu</h2>
<form name="tambah" method="post" action ="?tampil=menu_tambahproses">
<table>
<tr>
<td>Judul Menu</td>
<td><input type="text" name="judul"></td>
</tr>
<tr>
<td>link</td>
<td><input type="text" name="link"></td>
</tr>
<tr>
<td>Urutan</td>
<td><input type="text" name="urutan"></td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="tambah" value="tambah"</td>
</tr>
</table>
</form>
Spoiler for menu_tampil.php:
<h2>Data Menu</h2>
<a href="?tampil=menu_tambah">Tambah Menu</a><br><br>
<table width="100%" cellspacing="0" class="data" border="1">
<tr>
<th>No</th>
<th>Judul Menu</th>
<th>Link</th>
<th>Urutan</th>
<th>Aksi</th>
</tr>
<?php
$no=1;
$sql = mysql_query("SELECT * FROM menu order by 'urutan'")
or die(mysql_error());
while($data=mysql_fetch_array($sql)){
?>
<tr>
<td> <?php echo $no; ?> </td>
<td> <?php echo $data['judul'];?> </td>
<td> <?php echo $data['link'];?> </td>
<td> <?php echo $data['urutan'];?> </td>
<td>
<a href="?tampil=menu_edit&id=
<?php echo $data['id_menu']; ?>"> Edit</a> |
<a href="?tampil=menu_hapus&id=
<?php echo $data['id_hapus']; ?>"> Hapus</a>
</td>
</tr>
<?php
$no++;
}
?>
</table>
Tolong ya gan