diff options
Diffstat (limited to 'src/templates')
| -rw-r--r-- | src/templates/delete.php | 15 | ||||
| -rw-r--r-- | src/templates/index.php | 2 |
2 files changed, 16 insertions, 1 deletions
diff --git a/src/templates/delete.php b/src/templates/delete.php new file mode 100644 index 0000000..1be762b --- /dev/null +++ b/src/templates/delete.php @@ -0,0 +1,15 @@ +<!doctype html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <title>Bookmarks</title> + </head> + <body> + <form action="/delete" method="POST"> + <input type="hidden" name="id" value="<?php echo $bookmark->id; ?>"/> + <?php echo $bookmark->url.' '.$bookmark->title.' '.$bookmark->tag; ?> + <button type="submit">Delete</button> + </form> + </body> +</html> diff --git a/src/templates/index.php b/src/templates/index.php index 2703851..1298985 100644 --- a/src/templates/index.php +++ b/src/templates/index.php @@ -8,7 +8,7 @@ <body> <ul> <?php foreach ($bookmarks as $bookmark) { ?> - <li><a href="/edit?id=<?php echo $bookmark->id; ?>"><?php echo $bookmark->title; ?></a></li> + <li><a href="/edit?id=<?php echo $bookmark->id; ?>"><?php echo $bookmark->title; ?></a> | <a href="/delete?id=<?php echo $bookmark->id; ?>">Delete</a></li> <?php } ?> </ul> </body> |
