MOON
Server: Apache/2.2.34 (Unix) mod_ssl/2.2.34 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 FrontPage/5.0.2.2635
System: Linux server.asjudinet.com 2.6.32-042stab141.3 #1 SMP Fri Nov 15 22:45:34 MSK 2019 i686
User: asjudine (504)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: /home/asjudine/www/descargar_archivosdos.php
<?php
require_once("mainfile.php");
require_once("Conectarse.php");
include ("config.php");
global $dbi;


	
//$query_Recordset1 = "SELECT * FROM archivos where id = $Id";
//$Recordset1 = mysql_query($query_Recordset1, $dbi) or die(mysql_error());

			$result = mysql_query('SELECT * FROM archivos WHERE id = "' . $_GET["Id"]  . '"');
			if (!$result) {
				die('Invalid query: ' . mysql_error());
			}



if ((mysql_num_rows($result)!=0)) 
{


//		if ((mysql_num_rows($Recordset1)!=0)) 
//		{	 

//			list($Id, $nombre, $fechar, $hora, $contenido, $tipo, $Identificacion, $registro, $registro_interno)  = mysql_fetch_row($Recordset1);
			$row = mysql_fetch_row($result);

			$id = $row[0];
			$nombre = $row[9];
			$contenido = $row[10];
			$tipo = $row[11];
			
			
			
			
//		}			
		
			
/*		$nombre = mysql_result($Recordset1, 0, "nombre");
		$tipo = mysql_result($Recordset1, 0, "tipo");
		$contenido = mysql_result($Recordset1, 0, "contenido");*/



header("Content-type: $tipo");
header("Content-Disposition: attachment; filename=$nombre");
print $contenido; 
//echo $contenido;


}



else 

{
	
				$result = mysql_query('SELECT * FROM archivos_nuevos WHERE id = "' . $_GET["Id"]  . '"');
			if (!$result) {
				die('Invalid query: ' . mysql_error());
			}






//		if ((mysql_num_rows($Recordset1)!=0)) 
//		{	 

//			list($Id, $nombre, $fechar, $hora, $contenido, $tipo, $Identificacion, $registro, $registro_interno)  = mysql_fetch_row($Recordset1);
			$row = mysql_fetch_row($result);

			$id = $row[0];
			$nombre = $row[9];
			$contenido = $row[10];
			$tipo = $row[11];
			
//		}			
		
			
/*		$nombre = mysql_result($Recordset1, 0, "nombre");
		$tipo = mysql_result($Recordset1, 0, "tipo");
		$contenido = mysql_result($Recordset1, 0, "contenido");*/



header("Content-type: $tipo");
header("Content-Disposition: attachment; filename=$nombre");
print $contenido; 
//echo $contenido;


}
	


?>