num_rows == 0){ $accionForm = "errorEtiqueta.php"; $esta = "Error"; $method = "POST"; }else{ $idRegistro = ''; while($rowReg = mysqli_fetch_assoc($gstReg)){ $idRegistro = $rowReg["IDREGISTRO"]; } $qryProducto = "SELECT GL.LINEA, GL.MODELO, GL.SUBMODELO, PR.ARCH_FICH FROM ITT_ALP_GLOBAL AS GL LEFT JOIN ITT_ASW_PROD AS PR ON PR.SUBM = GL.SUBMODELO WHERE GL.ID = '$idRegistro' LIMIT 1"; $gstProducto = mysqli_query($conexion, $qryProducto); while($rowProd = mysqli_fetch_assoc($gstProducto)){ $linea = $rowProd["LINEA"]; $modelo = $rowProd["MODELO"]; $submodelo = $rowProd["SUBMODELO"]; $ficha = $rowProd["ARCH_FICH"]; } $accionForm = "producto.php"; $esta = "Exito"; $method = "GET"; } $qryRegistrarConsulta = "INSERT INTO ITT_ASW_ETQR (FEHR, IPUS, CAQR, ESTA) VALUES ('$date', '$ip', '$cadqr', '$esta')"; $gstRegCons = mysqli_query($conexion, $qryRegistrarConsulta); if($ficha !== null){ $location = $ficha; if(file_exists($location)){ $name = basename($location); $name = urlencode($name); header("Content-type: application/pdf"); header('Content-Disposition: inline; filename="' . $name . '"'); header('Expires: 0'); header('Cache-Control: must-rSomething is wrongidate'); header('Pragma: public'); header('Content-Length: ' . filesize($location)); // Send the file to the browser. readfile($location); exit; } } } } ?>