markleyco23

index

Nov 11th, 2018
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. <?php include('server.php')
  2. ?>
  3. <!doctype html>
  4. <html>
  5. <head>
  6. <TITLE>CRUD</TITLE>
  7. <link rel="stylesheet" type="text/css" href="style.css">
  8. </head>
  9. <body>
  10. <?php if (isset($_SESSION['message'])): ?>
  11. <div class="msg">
  12. <?php
  13. echo $_SEESION['message'];
  14. unset($_SEESION['message']);
  15. ?>
  16. </div>
  17. <?php end if ?>
  18. <table>
  19. <thead>
  20. <tr>
  21. <th>name</th>
  22. <th>Address</th>
  23. <th colspan="2">ACTION</th>
  24. </tr>
  25. </thead>
  26. <tbody>
  27. <?php while ($row = mysqli_fetch_array($results)) { ?>
  28. <tr>
  29. <td><?php echo $row['name']; ?></td>
  30. <td><?php echo $row['addres']; ?></td>
  31. <td>
  32. <a class="edit_btn" href="index.php? echo $row['id']; ?>">Edit</a>
  33. </td>
  34. <td>
  35. <a class ="del_btn" href="server.php?del=<?php echo $row['id']; ?>">Delete</a>
  36. </td>
  37. </tr>
  38. <?php } ?>
  39. </tbody> </table>
  40. <form method="post" action="server.php">
  41. <input type="hidden" name="id" value="<?php echo $id; ?>">
  42. <div class="input-group">
  43. <label>Name</label>
  44. <input type="text" name="name" value="<?php echo $name; ?>">
  45. </div>
  46. <div class="input-group">
  47. <?php if($update == false: ?>
  48. <button class="btn" type="submit" name="save" >Save</button>
  49. <?php else: ?>
  50. <button class="btn" type="submit" name="update" >update</button>
  51. <?php endif ?>
  52. </div>
  53. </form>
  54.  
  55. </body>
  56. </html>
Add Comment
Please, Sign In to add comment