Advertisement
Guest User

Untitled

a guest
Sep 1st, 2016
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. CONFIG.PHP
  2.  
  3. <?php
  4. $host = 'localhost';
  5. $user = 'root';
  6. $pass = '';
  7. $dbname = 'penjualan_ikan';
  8. $connect = mysql_connect($host, $user, $pass) or die(mysql_error());
  9. $dbselect = mysql_select_db($dbname); 'pemesanan';
  10. ?>
  11.  
  12. ADMIN.PHP
  13. <?php include('koneksi.php') ?>
  14. <h1>Admin</h1>
  15. <form action="" method="POST">
  16. Username:<input type="text" name="admin" size="20" maxlenght="9" class="form-control">
  17.  
  18. Password:<input type="password" name="password" size="20" class="form-control">
  19. <br><input type="submit" name="submit" class="btn btn-primary">
  20. <input type="reset" name="cancel" class="btn btn-primary">
  21. </form>
  22. </div><!-- container -->
  23. </body>
  24. </html>
  25.  
  26. <?php if (isset($_POST['submit']))
  27. {
  28. if (!empty($_POST['admin']) && !empty($_POST['password'])) {
  29. if ($_POST['admin']=="admin" && $_POST['password']=="123"){
  30. header('location:viewadmin.php');
  31. }
  32. } else {
  33. echo 'login gagal';
  34. }
  35. }
  36.  
  37.  
  38. KONEKSI.PHP
  39. <?php
  40. $host = "localhost";
  41. $user = "root";
  42. $pass = "";
  43. $db = "penjualan_ikan";
  44. $koneksi = mysqli_connect($host, $user, $pass, $db);
  45. if(mysqli_connect_errno()){
  46. echo "Gagal Terhubung ".mysqli_connect_error();
  47. }
  48. ?>
  49.  
  50.  
  51. <?php include('config.php') ?>
  52. <!DOCTYPE html>
  53. <html>
  54.  
  55. VIEWADMIN.PHP
  56. <body>
  57. <?php
  58. include('tips.php');
  59. ?>
  60.  
  61. <?php
  62. include('tabeldaya.php');
  63. ?>
  64.  
  65. </body>
  66. </html>
  67.  
  68. DELETE.PHP
  69. <?php
  70. include('config.php');
  71.  
  72. $id = $_GET['id'];
  73.  
  74. $query = mysql_query("delete from penjualan_ikan where pemesanan=$id") or die(mysql_error());
  75.  
  76. if ($query) {
  77. header('location:viewadmin.php');
  78. }
  79. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement