add shortcutes

change delete renames instead of unlink
This commit is contained in:
quenousimporte 2024-02-13 23:17:10 +01:00
parent 7f35822090
commit d28322e983
1 changed files with 3 additions and 3 deletions

View File

@ -34,7 +34,7 @@
</style> </style>
</head> </head>
<body> <body>
<div><a href="index.php">View list</a>&nbsp;<a href="index.php?create=true">New note</a>&nbsp;|&nbsp;bbn</div> <div><a accesskey="l" href="index.php">View list</a>&nbsp;<a accesskey="n" href="index.php?create=true">New note</a>&nbsp;|&nbsp;bbn</div>
<br> <br>
<?php <?php
if (isset($_POST['savebutton'])) if (isset($_POST['savebutton']))
@ -47,7 +47,7 @@
else if (isset($_POST['deletebutton'])) else if (isset($_POST['deletebutton']))
{ {
$title = $_POST['title']; $title = $_POST['title'];
unlink($dir . '/' . $title); rename($dir . '/' . $title, $dir . '/' . $title . '.del');
} }
else if (isset($_GET['create'])) else if (isset($_GET['create']))
{ {
@ -64,13 +64,13 @@
echo '<form action="index.php" method="POST"> echo '<form action="index.php" method="POST">
<div> <div>
<input name="title" value="' . $title . '"> <input name="title" value="' . $title . '">
<!--<input type="submit" name="deletebutton" value="delete">-->
</div> </div>
<br> <br>
<div> <div>
<textarea autofocus name="content" spellcheck="false">' . $content . '</textarea> <textarea autofocus name="content" spellcheck="false">' . $content . '</textarea>
</div> </div>
<input type="submit" name="savebutton" value="save" accesskey="s"> <input type="submit" name="savebutton" value="save" accesskey="s">
<input accesskey="d" type="submit" name="deletebutton" value="delete">
</form>'; </form>';
} }
else else