<?
if (!jeprihlasen()) return;
if (!is_numeric($_REQUEST["pisen"])) return;
$vysledek=mysql_query("select pisne.nazev, texty.textpisne from pisne inner join texty on pisne.id=texty.pisen where pisne.id=".$_REQUEST["pisen"],$GLOBALS["link"]);
if (mysql_num_rows($vysledek)==0) echo "Tato píseň není v databázi, nebo k ní není zadán text";
else
{
ob_end_clean();
header("Content-Description: File Transfer");
header("Content-Type: application/force-download");
header("Content-Disposition: attachment; filename=\"pisen.txt\"");
$zaznam=MySQL_Fetch_Array($vysledek);
echo $zaznam["nazev"]."\n".$zaznam["textpisne"];
die();
}
?>