2018-11-18 13:00:46 +01:00
|
|
|
<?php
|
|
|
|
if( !isset( $_SESSION ) ) session_start();
|
|
|
|
if(empty($_SESSION['user'])){
|
2018-12-13 00:58:38 +01:00
|
|
|
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();
|
|
|
|
|
2018-12-13 00:58:38 +01:00
|
|
|
header ("Location: ./");
|
2018-11-18 13:00:46 +01:00
|
|
|
?>
|