itskp-odense/Backend/controller/update.php

18 lines
367 B
PHP
Raw Normal View History

2021-06-02 11:27:13 +00:00
<?php
require "../../bootstrap.php";
use Backend\Model\Post;
if(isset($_POST['update'])){
$post = Post::query()->find($_POST['id']);
$post->title = $_POST['upTitle'];
$post->description = $_POST['upDescription'];
2021-06-02 11:27:13 +00:00
if(!$post->update()){
echo "Error could not update";
}else{
header("location: ../../Frontend/admin.php");
2021-06-02 11:27:13 +00:00
}
}