<?php
 	session_start(); 

	if(!isset($_SESSION['tulsilogin']))
	{
		header('Location: index.php');
		return;	
	}
	
	





$_SESSION['_token']=bin2hex(openssl_random_pseudo_bytes(16));

	

	

	include("connect.php");
include("mylibrary.php");


	
	
	$cmessage=checkvalidstring($_POST['cmessage']);
	$commid=$_POST['commid'];
	
	

	

	 $eve = "update res_communication_master set cmessage='$cmessage'  where commid='$commid'";

	

	if ($conn->query($eve) === TRUE)

	{		

		$_SESSION['msg'] = " Record Updated succesfully";

		header('Location: template.php');		

	} 

	else 

	{

			

		$_SESSION['msg'] = "Error";

		header('Location: template.php');

	}
	

?>