<?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(strcmp($Message1,undefined)==0)
	{$Message1=' ';}
	if(strcmp($Message2,undefined)==0)
	{$Message2=' ';}	
	if(strcmp($longMessage,undefined)==0)
	{$longMessage=' ';}
    if($query_data['flag']==1)
     	   {
		   echo "yes"; //message all ready exists
			//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')";
	$addClient ="UPDATE news SET longMessage='$longMessage',Message1='$Message1',Message2='$Message2' WHERE flag=1";
    mysql_query($addClient) or die(mysql_error());
	}
?>