webForumDet fria alternativet

databasen uppdateras inte

PHPur PHP

0 svar · 142 visningar · startad av Niehls

Medlem sedan juli 2002131 inlägg
Frågan#1

jag har fixat ett enkelt enkelt kösystem för nedladdning.
kontentan är följande:

		if (file_exists($fullpath)) 
			{ 
			//header("Content-type: application/zip"); 
			// might need the above... left it in here for future possible use - 
			// although the line below worked with zips
			header("Content-type: application/octet-stream");
			header("Content-Disposition: attachment; filename=\"$p\""); 
			header("Content-Transfer-Encoding: binary"); 
			header("Content-length: ".(string)($file_size)); 
				if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE'))
				{ 
				// IE cannot download from sessions without a cache 
				header('Cache-Control: public'); 
				} 
			mysql_query("update downloads set active='1' , place_in_line='0' where download_id=$_GET[download_id]'");
			
			
				readfile($fullpath);
				
						mysql_query("update downloads set active='0' where download_id='$_GET[download_id]'");
				
			
			mysql_close();
			} 
			else 
			{ 
			print "not found"; 
			die(); 
			}

problemet är att efter readfile($fullpath) så uppdateras databasen *ibland*. detta verkar ske ganska slumpmässigt.
även vid:

if(readfile($fullpath))
{
    mysql_grejs_grejs();
}

så fungerar det ungefär lika.

nån som vet hur man kan utföra ett kommando när hela filen laddats ner?

132 ms totalt · 3 externa anrop · v20260731065814-full.b746b907
0 ms — hämta forumlista (cache)
0 ms — hämta statistik (cache)
130 ms — hämta tråd, inlägg och bilagor (db)