TAS-ALFA/admin-zone/update_post.php

25 lines
631 B
PHP
Raw Permalink Normal View History

2018-11-18 13:00:46 +01:00
<?php
if( !isset( $_SESSION ) ) session_start();
if(empty($_SESSION['user'])){
header('Location: ./login.php');
2018-11-18 13:00:46 +01:00
}
else{
$user=$_SESSION['user'];
$post_id=$_SESSION['post_id'];
}
include "../settings/db_connect.php";
$text=$_POST['post_text'];
$meta_desc=$_POST['meta_desc'];
$title=$_POST['title'];
$mod_date=date("Y-m-d H:i:s");
$sql = $mysqli->prepare("UPDATE post SET tytul=?,opis=?,tekst=?,data_modyfikacji=? WHERE post_id=?;");
if ($sql)
{
2018-12-17 11:56:29 +01:00
$sql->bind_param("ssssi",$title,$meta_desc,$text,$mod_date,$post_id);
2018-11-18 13:00:46 +01:00
$sql->execute();
$sql->close();
}
$mysqli->close();
header ("Location: ./");
2018-11-18 13:00:46 +01:00
?>