From ee9428a6fe3eb4a22930ef51e8fa504818ce743a Mon Sep 17 00:00:00 2001
From: quenousimporte
Date: Wed, 14 Feb 2024 08:41:48 +0100
Subject: [PATCH] change no authent if no password change create note if not
exists change labels
---
index.php | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/index.php b/index.php
index e1e1397..af4d5bc 100644
--- a/index.php
+++ b/index.php
@@ -34,18 +34,18 @@
- View list New note
Access denied.
';
exit;
}
+ echo 'List New';
+
if (isset($_POST['savebutton']))
{
$title = $_POST['title'];
@@ -58,17 +58,20 @@
$title = $_POST['title'];
rename($dir . '/' . $title, $dir . '/' . $title . '.del');
}
- else if (isset($_GET['create']))
- {
- $title = time() . '.md';
- file_put_contents($dir . '/' . $title, '');
- $_GET['open'] = $title;
- }
if (isset($_GET['open']))
{
$title = $_GET['open'];
- $content = file_get_contents($dir . '/' . $title);
+
+ $content = '';
+ if (!file_exists($dir . '/' . $title))
+ {
+ file_put_contents($dir . '/' . $title, $content);
+ }
+ else
+ {
+ $content = file_get_contents($dir . '/' . $title);
+ }
echo '