Files
itskp-odense/Backend/controller/update.php
T
Anders 350b22923a v0.1.0 - Updated Deletetion of post
Updated home to admin
Updated create & fetch
Added DataTables
Added Icons for DataTables
Added SWAL
2021-06-08 09:07:58 +02:00

18 lines
367 B
PHP

<?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'];
if(!$post->update()){
echo "Error could not update";
}else{
header("location: ../../Frontend/admin.php");
}
}