Añadir 'blog.php'

This commit is contained in:
Lucas 2021-04-09 15:30:55 +00:00
parent 03344f43dd
commit 107b0e3501
1 changed files with 20 additions and 0 deletions

20
blog.php Normal file
View File

@ -0,0 +1,20 @@
<?php include "blog_config.php"; if(isset($_GET["p"])){
function notfound($errno, $errstr) {
echo "Error!\nPost not found";
}
set_error_handler("notfound");
header("Content-type: text/plain");
echo $posts[$_GET["p"]][2];
} else {
header("Content-type: text/html");
echo "<!DOCTYPE html><html><head><title>$title</title></head><body style='font-family:monospace'><h1>$title</h1>"
$a=count($posts)-1;
$ao=0;
$next=$a+1;
while($ao < count($posts)){
if(strpos($posts[$r][1],"'")){$title=str_replace("'", "\\'", $posts[$a][1]);}else{$title=$posts[$a][1];}
echo "<p><a href='?p=$next'>$title</a><br>".$posts[$a][0]."</p><br>";
$a--; $ao++; $next--;
}
echo "<p><a href='https://tildegit.org/blog-soft'>Source code</a></p></body></html>";
} ?>