<?php
$recepient=$_POST["user_message"];
$type_message=$_POST["type_message"];
$sender=$_SESSION["rolenumber"];
$yy=date("Y");
$fyy=substr($yy,2,2);
$mm=date("m");
$dd=date("d");
$hi=date("h");
$mi=date("i");
$sa=date("sa");
$fsa=substr($sa,0,2);   
$messageid="mess".$fyy.$mm.$dd.$hi.$mi.$fsa;

$insert_messages=$dbh->query("insert into message (message,recepient,sender,messageid) values('$type_message','$recepient','$sender','$messageid')");
?>