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>
</head>
<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>
<?php
if (isset($_POST['savebutton']))
@ -47,7 +47,7 @@
else if (isset($_POST['deletebutton']))
{
$title = $_POST['title'];
unlink($dir . '/' . $title);
rename($dir . '/' . $title, $dir . '/' . $title . '.del');
}
else if (isset($_GET['create']))
{
@ -64,13 +64,13 @@
echo '<form action="index.php" method="POST">
<div>
<input name="title" value="' . $title . '">
<!--<input type="submit" name="deletebutton" value="delete">-->
</div>
<br>
<div>
<textarea autofocus name="content" spellcheck="false">' . $content . '</textarea>
</div>
<input type="submit" name="savebutton" value="save" accesskey="s">
<input accesskey="d" type="submit" name="deletebutton" value="delete">
</form>';
}
else