1) Script in event time and server time is equal after message send to user
2) Every 2 second page will be refresh.
<?php
//header('Content-Type: text/event-stream');
header('Cache-Control: no-cache');
@include("include/db_connection.php");
//include("user_notification_list.php");
$page = $_SERVER['PHP_SELF'];
$sec = "2";
?>
<html>
<head>
<meta http-equiv="refresh" content="<?php echo $sec?>;URL='<?php echo $page?>'">
</head>
<body>
<?php
$query= mysql_query("SELECT event_date FROM
tbl_notification_list where main_id =96");
$row= mysql_fetch_array($query);
$event_time= $row['event_date'].'</br>';
$server_time= date('m-d-y h:iA');
ob_flush();
flush();
ECHO $event_time;
ECHO $server_time;
$a= $event_time;// '04-07-14 09:14PM';
$b= $server_time; // '04-07-14 09:15PM';09:15PM';
if($a==$b)
{
echo 'Message send success fully.';
}else
{
echo'comming sonn event.';
}
echo'</br>';
?>
</body>
</html>