<?php 
require("common_begin.php");

$lst = Listopia::getInstance();

if ($lst->isLoggedIn() && isset($_POST['id']))
{
  $query = $lst->Database()->select(array(
                'fields' => 'mess_content',
                'table' => 'messages',
                'condition' => 'mess_id = '.((int)$_POST['id'])
                ));
                
  if (!empty($query[0]))
  {
    echo $query[0]['messages']['mess_content'];
  }
  else
  {
    echo "Error retreiving message";
  }
}
else
{
  echo "Not logged in";
}

require("common_end.php");

