<?php
$headlines=$_POST["headlines"];
$content=$_POST["content"];

$uid_login=$_SESSION["uid_login"];

$sql = "INSERT INTO news (nid, headlines, content, date_add, uid)
VALUES (NULL, '$headlines', '$content', current_timestamp(),'$uid_login')";

if (mysqli_query($conn, $sql)) {
  echo "New record created successfully";
  echo"<meta http-equiv=\"refresh\" content=\"1;url=?page=news\">";
} else {
  echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}

mysqli_close($conn);
?>