Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php include('server.php')
- ?>
- <!doctype html>
- <html>
- <head>
- <TITLE>CRUD</TITLE>
- <link rel="stylesheet" type="text/css" href="style.css">
- </head>
- <body>
- <?php if (isset($_SESSION['message'])): ?>
- <div class="msg">
- <?php
- echo $_SEESION['message'];
- unset($_SEESION['message']);
- ?>
- </div>
- <?php end if ?>
- <table>
- <thead>
- <tr>
- <th>name</th>
- <th>Address</th>
- <th colspan="2">ACTION</th>
- </tr>
- </thead>
- <tbody>
- <?php while ($row = mysqli_fetch_array($results)) { ?>
- <tr>
- <td><?php echo $row['name']; ?></td>
- <td><?php echo $row['addres']; ?></td>
- <td>
- <a class="edit_btn" href="index.php? echo $row['id']; ?>">Edit</a>
- </td>
- <td>
- <a class ="del_btn" href="server.php?del=<?php echo $row['id']; ?>">Delete</a>
- </td>
- </tr>
- <?php } ?>
- </tbody> </table>
- <form method="post" action="server.php">
- <input type="hidden" name="id" value="<?php echo $id; ?>">
- <div class="input-group">
- <label>Name</label>
- <input type="text" name="name" value="<?php echo $name; ?>">
- </div>
- <div class="input-group">
- <?php if($update == false: ?>
- <button class="btn" type="submit" name="save" >Save</button>
- <?php else: ?>
- <button class="btn" type="submit" name="update" >update</button>
- <?php endif ?>
- </div>
- </form>
- </body>
- </html>
Add Comment
Please, Sign In to add comment