preventing multiple downloads fromthe same ip address
<pre><code>$filename = $link; 
if(ini_get('zlib.output_compression'))
      ini_set('zlib.output_compression', 'Off');
    // addition by Jorg Weske
    $file_extension = strtolower(substr(strrchr($filename,"."),1));
$fullPath=$filename;


    if($fd = fopen ($fullPath, "r")) 
    {
      //  $fsize = filesize($fullPath);
        $path_parts = pathinfo($fullPath);
        $ext = strtolower($path_parts["extension"]);
        switch ($ext) 
        {
            case "pdf":
            header("Content-type: application/pdf"); // add here more headers for diff. extensions
            header("Content-Disposition: attachment; filename=\"".$path_parts["basename"]."\""); // use 'attachment' to force a download
            break;
            default;
            header("Content-type: application/octet-stream");
            header("Content-Disposition: filename=\"".$path_parts["basename"]."\"");
        }
       // header("Content-length: $fsize");
       // header("Cache-control: private"); //use this to open files directly
        while(!feof($fd)) 
        {
            $buffer = fread($fd, 2048);
            echo $buffer;
        }
    }
fclose ($fd);
</code></pre>

<p>hai,this is my code for file downloading, how can i prevent multiple downloads from the same ip address at the same time in php,help me pls...</p>
