<?php
session_start();
include 'dbh.php';
$msg=$_POST['msg'];
$name=$_SESSION['name'];
$sql="insert into posts(msg,name) values ('$msg','$name')";
$result=mysqli_query($conn, $sql);
header("Location:home.php");
?>
<form method="post" action="send.php">
<textarea name="msg" placeholder="Type to send message..." class="form-control"></textarea><br>
<input type="submit" value="Send">
</form><br>