fixed links

This commit is contained in:
quenousimporte 2024-02-13 23:05:54 +01:00
parent 100ba92888
commit 7f35822090
1 changed files with 5 additions and 6 deletions

View File

@ -1,5 +1,7 @@
<?php <?php
$password = ''; $password = '';
$dir = '../../data/bbn';
if (!isset($_SERVER['PHP_AUTH_PW']) || $_SERVER['PHP_AUTH_PW'] != $password) { if (!isset($_SERVER['PHP_AUTH_PW']) || $_SERVER['PHP_AUTH_PW'] != $password) {
header('WWW-Authenticate: Basic realm="bbn"'); header('WWW-Authenticate: Basic realm="bbn"');
header('HTTP/1.0 401 Unauthorized'); header('HTTP/1.0 401 Unauthorized');
@ -32,12 +34,9 @@
</style> </style>
</head> </head>
<body> <body>
<div><a href="bbn.php">View list</a>&nbsp;<a href="bbn.php?create=true">New note</a>&nbsp;|&nbsp;bbn</div> <div><a href="index.php">View list</a>&nbsp;<a href="index.php?create=true">New note</a>&nbsp;|&nbsp;bbn</div>
<br> <br>
<?php <?php
$dir = '../data';
if (isset($_POST['savebutton'])) if (isset($_POST['savebutton']))
{ {
$title = $_POST['title']; $title = $_POST['title'];
@ -62,7 +61,7 @@
$title = $_GET['open']; $title = $_GET['open'];
$content = file_get_contents($dir . '/' . $title); $content = file_get_contents($dir . '/' . $title);
echo '<form action="bbn.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">--> <!--<input type="submit" name="deletebutton" value="delete">-->
@ -80,7 +79,7 @@
while (($file = readdir($dh)) !== false) { while (($file = readdir($dh)) !== false) {
if (str_ends_with($file, '.md')) if (str_ends_with($file, '.md'))
{ {
echo '<div><a href=bbn.php?open=' . urlencode($file) . '>' . $file .'</a></div>'; echo '<div><a href=index.php?open=' . urlencode($file) . '>' . $file .'</a></div>';
} }
} }
closedir($dh); closedir($dh);