30 lines
892 B
PHP
30 lines
892 B
PHP
<?php
|
|
session_start();
|
|
require_once 'php/model/Article.php';
|
|
require_once 'php/model/ArticleManager.php';
|
|
|
|
if (isset($_GET["id"]) && !empty($_GET["id"])){
|
|
try {
|
|
$id = $_GET["id"];
|
|
$articleManager = ArticleManager::getInstance();
|
|
$article = $articleManager->getArticle($id);
|
|
if($article != null){
|
|
$title = $article->getTitle();
|
|
$content = $article->getContent();
|
|
$category = $article->getCategory();
|
|
$author = $article->getAuthor();
|
|
$tags = $article->getTags();
|
|
}else{
|
|
echo "Test";
|
|
header("Location: index.php?pfad=404");
|
|
exit();
|
|
}
|
|
} catch (Exception $e){
|
|
$_SESSION["message"] = "internal_error";
|
|
header("location: ../../index.php?pfad=showArticle");
|
|
exit();
|
|
}
|
|
}else{
|
|
$_SESSION["message"] = "missing_id";
|
|
}
|
|
?>
|