<?

  $bad_words = array ('select', 'insert', 'delete', 'update', 'drop table', 'union', 'null');
  for ($i = 0; $i < sizeof ($_GET); ++$i)
  {
    for ($j = 0; $j < sizeof ($bad_words); ++$j)
    {
      if (preg_match ('/' . $bad_words[$j] . '/', $_GET[key ($_GET)]))
      {
        $temp = key ($_GET);
        $_GET[$temp] = '';
        continue;
      }
    }

    next ($_GET);
  }

  header ('Content-type: application/xml');
  include '../config.inc.php';
  if (!($result = mysql_query ('SELECT * FROM articles WHERE id=\'' . $_GET['id'] . '\'')))
  {
    exit ('<b>Error:</b>' . mysql_error ());
    ;
  }

  $row = mysql_fetch_array ($result);
  if (!($result1 = mysql_query ('select * from properties')))
  {
    exit ('<b>Error:</b>' . mysql_error ());
    ;
  }

  $row1 = mysql_fetch_row ($result1);
  for ($i = 0; $i < sizeof ($row1); ++$i)
  {
    define (mysql_field_name ($result1, $i), $row1[$i]);
  }

  echo '<?xml version="1.0" encoding="' . encoding . '"?>
';
  echo '<rss version="2.0">
<channel>

	<title>';
  echo title;
  echo '</title>
	<link>';
  echo $_SERVER['SERVER_NAME'];
  echo '</link>
	<description>';
  echo description;
  echo '</description>

<item>
	<title>';
  echo $row['title'];
  echo '</title>
	<link>';
  echo $_SERVER['SERVER_NAME'];
  echo '/?id=';
  echo $_GET['id'];
  echo '</link>
	<pubDate>';
  echo date ('r', $row['tim']);
  echo '</pubDate>
	<description>';
  echo $row['description'];
  echo '</description>
</item>
	
	
</channel>
</rss>';
?>
