Advertisement
Guest User

Untitled

a guest
Mar 9th, 2019
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.37 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title></title>
  5.  
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/…/4.0…/css/bootstrap.min.css">
  8. <script src="https://ajax.googleapis.com/…/li…/jquery/3.3.1/jquery.min.js"></script>
  9. <script src="https://cdnjs.cloudflare.com/…/pop…/1.12.9/umd/popper.min.js"></script>
  10. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/…/bootstrap.min.js"></script>
  11. </head>
  12. <body>
  13.  
  14. <?php require_once 'process.php'; ?>
  15. <?php
  16. if(isset($_SESSION['message'])): ?>
  17.  
  18. <div class="alert alert-<?=$_SESSION['msg_type']?>"> </div>
  19. <?php
  20.  
  21. echo $_SESSION['message'];
  22. unset($_SESSION['message']);
  23.  
  24. endif ?>
  25. <div class="contener">
  26. <?php
  27. $mysqli = new mysqli('localhost', 'root', 'rootroot','crud') or die(mysqli_error($mysqli));
  28. $result = $mysqli->query("SELECT * FORM data") or die($mysqli->error);
  29.  
  30. ?>
  31.  
  32. <div class="row justify-content-center">
  33. <table class="table">
  34. <thead>
  35. <tr>
  36. <th>usernames</th>
  37. <th>Passowrds</th>
  38. <th colspan="2">Action</th>
  39. <tr>
  40. </thead>
  41. </div>
  42. <?php while ($row = $result->fetch_assoc()): ?>
  43. <tr>
  44. <td><?php echo $row ['username'];?></td>
  45. <td><?php echo $row ['password'];?></td>
  46. <td>
  47. <a href="index.php?edit=<?php echo $row ['id']; ?>"
  48. class="btn btn-info">edit</a>
  49. <a hraf="process.php?delete=<?php echo $row ['id']; ?>"
  50. class="btn btn-danger">
  51. </td>
  52.  
  53. </tr>
  54.  
  55. <?php endwhile; ?>
  56. </table>
  57.  
  58. <?php
  59. function pre_r( $arry ){
  60. echo'<pre>';
  61. print_r($array);
  62. echo'</pre>';
  63.  
  64. }
  65. ?>
  66.  
  67. <div class="col-lg-6 m-auto">
  68.  
  69. <form action="process.php" method="post">
  70. <input type="hidden" name="id" value=" <?php echo $id; ?> " <br><br><div class="crud">
  71.  
  72. <div class="card-header bg-dark">
  73. <h1 class="text-white text-center"> Insert Operation </h1>
  74. </div><br>
  75.  
  76. <label> Username: </label>
  77. <input type="text" name="username" class="form-control" value=" <?php echo $username; ?> " placeholder="Enter Your Username"> <br>
  78.  
  79. <label> Password: </label>
  80. <input type="text" name="password"
  81. value=" <?php echo $password; ?> " class="form-control" placeholder="Password"> <br>
  82. <?php if ($update == true): ?>
  83. <button class="btn btn-info" type="submit" name="save"> Submit </button><br>
  84. <?php else: ?>
  85. <button class="btn btn-success" type="submit" name="save"> Submit </button><br>
  86. <?php endif; ?>
  87. </div>
  88. </form>
  89. </div>
  90. </div>
  91. </div>
  92.  
  93. </body>
  94. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement