trouble in download window
<p>[QUOTE=php_lover;4343082]Hi all , I've writen a piece of code downloading file from mysql , here is the code : </p>

<p>php code :</p>

<pre><code>$query = "SELECT name, type, size, content ,downloaded FROM ".filtering($cat , 'str')." WHERE id = '".filtering($id , 'int')."'";

$result = mysqlquery($query) or die('Error, query failed !!!');
list($name, $type, $size, $content, $downloaded) = mysql_fetch_array($result);

header("Content-length: $size");
header("Content-type: $type");
header("Content-Disposition: attachment; filename=$name");

echo $content;
exit;
}
</code></pre>

<p>nothing is fail , when I try this script on my local machine the download window appears to me that where I whould download the file but when I try it on my server the download window won't appear and the content of file is shown on browser </p>

<p>for example when I want download .rar file these codes appear exchange of downloading window :</p>

<pre><code>EVئ€#%   ئ€"%   èï‹ ‹}3غYئD0 C‹uhSC Vèڈ …ہYY…¢   9E„=‏ےے…ےj^‰uüŒQ‏ےےےujXè(üےے…ہY…=‏ےے…ےtےu3ہےuèûےےYYé%‏ےے‹Mٹ‹ٌë&lt;:tFٹ„ہuُ€&gt; „µ   ‹ئ+ء=   r¸ے  P‹Eےu¬  Pèظ‹ ‹EFVئ€«   è›چ ‹M‹uƒؤ‰پ¬  hSC Vè^ژ …ہYY…ئ   9E„†‎ےے…ےj[‰]üŒ‎ےےVjXèsûےے…ہY…‎ےے…ے…†  hSC ے
</code></pre>
