Masalahnya cuma gak refresh atau gak kembali ke menu yg telah diedit. Tetapi data yang diedit tersimpan.
mohon bantuan,terimakasih
  1.  
  2. <fieldset>
  3. <legend>Edit Soal Tugas</legend>
  4.  
  5. <?php
  6. $id = @$_GET['id'];
  7. $sql = mysql_query("select * from soaltugas where id = '$id'") or die (mysql_error());
  8. $data = mysql_fetch_array($sql);
  9. ?>
  10. <form action="" method="post" enctype="multipart/form-data">
  11. <table>
  12. <tr>
  13. <td>id</td>
  14. <td>:</td>
  15. <td><input type="text" name="id" value="<?php echo $data['id']; ?>" /></td>
  16. </tr>
  17. <tr>
  18. <td>judul_tugas</td>
  19. <td>:</td>
  20. <td><input type="text" name="judul_tugas" value="<?php echo $data['judul_tugas']; ?>" /></td>
  21. </tr>
  22. <tr>
  23. <td>kode_matkul</td>
  24. <td>:</td>
  25. <td><input type="text" name="kode_matkul" value="<?php echo $data['kode_matkul']; ?>" /></td>
  26. </tr>
  27. <tr>
  28. <td>keterangan</td>
  29. <td>:</td>
  30. <td><input type="text" name="keterangan" value="<?php echo $data['keterangan']; ?>" /></td>
  31. </tr>
  32. <tr>
  33. <td>filename</td>
  34. <td>:</td>
  35. <td><input type="text" name="filename" value="<?php echo $data['filename']; ?>" /></td>
  36. </tr>
  37. <tr>
  38. <td>location</td>
  39. <td>:</td>
  40. <td><input type="text" name="location" value="<?php echo $data['location']; ?>" /></td>
  41. </tr>
  42. <tr>
  43. <td></td>
  44. <td></td>
  45. <td><input type="submit" name="edit" value="Edit" /></td>
  46. </tr>
  47. </table>
  48. </form>
  49. <?php
  50. $id = @$_POST['id'];
  51. $judul_tugas = @$_POST['judul_tugas'];
  52. $kode_matkul = @$_POST['kode_matkul'];
  53. $keterangan = @$_POST['keterangan'];
  54. $filename = @$_POST['filename'];
  55. $location = @$_POST['location'];
  56.  
  57. $edit_soal = @$_POST['edit_soal'];
  58.  
  59. if($edit_soal) {
  60. if($id == "" || $judul_tugas == "" || $kode_matkul == "" || $keterangan == "" || $filename == "" || $location == "")
  61. ?>
  62. <script type="text/javascript">
  63. alert("tidak boleh ada yang kosong");
  64. </script>
  65. <?php
  66. } else {
  67. mysql_query("update soaltugas set
  68. judul_tugas = '$_POST[judul_tugas]',
  69. kode_matkul = '$_POST[kode_matkul]',
  70. keterangan = '$_POST[keterangan]',
  71. filename = '$_POST[filename]',
  72. location = '$_POST[location]'
  73. where id = '$_POST[id]'") or die (mysql_error());
  74.  
  75. if($edit_soal) {
  76. echo"Data telah diupdate";
  77. echo"<meta http-equiv='refresh' content='1; url=?page=Soal Tugas'>";
  78. }
  79. }
  80. ?>
  81. </fieldset>
15320
Please login to answer!
/sangkep/answer/add-json/nogzip/1
/sangkep/answer/send-notification