21 lines
444 B
PHP
21 lines
444 B
PHP
|
<?php
|
||
|
|
||
|
require "../../bootstrap.php";
|
||
|
|
||
|
use Backend\Model\Post;
|
||
|
|
||
|
if(isset($_POST['update'])){
|
||
|
$id = $_POST['id'];
|
||
|
$title = $_POST['upTitle'];
|
||
|
$description = $_POST['upDescription'];
|
||
|
$post = Post::query()->find($id)->first();
|
||
|
$post->title = $title;
|
||
|
$post->description = $description;
|
||
|
|
||
|
if(!$post->update()){
|
||
|
echo "Error could not update";
|
||
|
}else{
|
||
|
header("location: ../../Frontend/home.php");
|
||
|
}
|
||
|
}
|