<?php
        // where is your config file stored?
	include ("config.php");
	
	$longMessage = htmlspecialchars(trim($_POST['longMessage']));
	$Message1 = htmlspecialchars(trim($_POST['Message1']));
	$Message2 = htmlspecialchars(trim($_POST['Message2']));
	$query_disp="select * from news where flag=1";
$result_disp = mysql_query($query_disp);
$query_data = mysql_fetch_array($result_disp);
		
    if($query_data['flag']==1)
     	   echo "yes"; //message all ready exists
	 
		else
		{
		echo "no"; //New message details
		//now set the session from here if needed
		//$_SESSION['u_name']=$user_name; 
	$addClient  = "INSERT INTO news(longMessage,Message1,Message2,flag) VALUES ('$longMessage','$Message1','$Message2','1')";
    mysql_query($addClient) or die(mysql_error());
	}
?>