Fixed error messages

This commit is contained in:
Furentes
2019-05-23 09:12:05 +02:00
parent 61d77ff1a1
commit e381050e1d
5 changed files with 43 additions and 13 deletions

View File

@ -101,17 +101,6 @@ require_once(__DIR__."/inc/head.php");
}
?>
<?php
foreach ($errors as $key=>$value):
?>
<span style="color: red;">
<?= $value ?>
</span><br>
<?php
endforeach;
if($success == true) {
echo '<span style="color: green;">Post bearbeitet!</span><br>';
}
if ($action == 'view'):
?>
<div>
@ -131,6 +120,15 @@ require_once(__DIR__."/inc/head.php");
?>
</div>
<?php
foreach ($errors as $key=>$value):
?>
<br><span style="color: red;">
<?= $value ?>
</span>
<?php
endforeach;
?>
<?php
if ($auth->isLoggedIn()) {
?>
<p>
@ -162,6 +160,15 @@ require_once(__DIR__."/inc/head.php");
if ($action == 'new'):
?>
<h2>Neuer Beitrag</h2>
<?php
foreach ($errors as $key=>$value):
?>
<span style="color: red;">
<?= $value ?>
</span><br>
<?php
endforeach;
?>
<form action="<?= htmlspecialchars($_SERVER['REQUEST_URI']) ?>" method="post" class="clearfix">
<label for="title">Titel</label>
<input type="text" name="title" id="title" value="<?= (isset($_POST['title'])) ? htmlspecialchars($_POST['title']) : ''; ?>"><br>
@ -175,6 +182,18 @@ require_once(__DIR__."/inc/head.php");
if ($action == 'edit'):
?>
<h2>Beitrag Bearbeiten</h2>
<?php
if($success == true) {
echo '<span style="color: green;">Post bearbeitet!</span><br>';
}
foreach ($errors as $key=>$value):
?>
<span style="color: red;">
<?= $value ?>
</span><br>
<?php
endforeach;
?>
<form action="<?= htmlspecialchars($_SERVER['REQUEST_URI']) ?>" method="post" class="clearfix">
<label for="title">Titel</label>
<input type="text" name="title" id="title" value="<?= (isset($data['title'])) ? $data['title'] : $ptitle; ?>"><br>