ob_start("ob_gzhandler");
include("./includes/config.php");
include("./includes/function.php");
include("./includes/bbcode.php");
include("./includes/inquiry.php");
$id= trim($_GET['poemid']);
$cleanid = strip_tags($id);
$selectpoem = mysql_db_query("$dbName", "SELECT * FROM `divan` WHERE `divan_id` = '$cleanid'") ;
while ($pinfo = @mysql_fetch_assoc($selectpoem)){
$poemname= $pinfo[divan_title];
$poemcontaining= $pinfo[divan_containing];
}
$xmlpoem = $poemcontaining;
$xmlpoem = nl2br($xmlpoem);
$xmlpoem = str_replace("="," ",$xmlpoem);
$thispoem= $poemcontaining;
$thispoem = nltobr($thispoem);
$thispoem = str_replace("="," ",$thispoem);
//$delbbcode = strip_tags($delbbcode);
$cCharset = "windows-1256";
$sitename = $sitename;
$type= trim($_GET['type']);
$cleantype = strip_tags($type);
if(($cleantype)==('word')){
ExportToWord($thispoem,$poemname,$sitename,$sitelink,$cCharset);
}elseif(($cleantype)==('html')){
ExportToHtml($thispoem,$poemname,$sitename,$sitelink,$cCharset);
}elseif(($cleantype)==('rss')){
//export to xml file
header('Content-Type: text/xml');
echo '';
ECHO '
"; echo $thispoem ; echo " |
"; echo ""."جميع الحقوق محفوظة ".$sitename." |
$sitelink"; echo " |