function edit_post($connect, $post_id){
$post_id = $_GET['post_id'];
if(isset($_POST['submit'])){
$title = $_POST['title'];
$image = $_POST['image'];
$text = $_POST['text'];
$update = "UPDATE posts SET `title` = '$title', `image` = '$image', `text` = '$text' WHERE id = ".$post_id;
$result = mysqli_query($connect, $update);
header("Location: ". $_SERVER["REQUEST_URI"]);
}
}