v0.0.3 Made the delete function.
This commit is contained in:
@@ -1 +1,17 @@
|
||||
<?php
|
||||
|
||||
require "../../bootstrap.php";
|
||||
|
||||
use Backend\Model\Post;
|
||||
|
||||
if(isset($_GET['id'])){
|
||||
$id = $_GET['id'];
|
||||
$findId = Post::query()->findOrFail($id);
|
||||
|
||||
if(!$findId->delete()){
|
||||
echo "Error could not delete record";
|
||||
}else{
|
||||
header("location: ../../Frontend/home.php?recordDeleted");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,6 @@ if(isset($_POST['createPost'])){
|
||||
echo "Failed to save the post";
|
||||
exit();
|
||||
}else{
|
||||
echo "Post has been saved";
|
||||
header("location: ../../Frontend/home.php?Post=UploadSuccess");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user