Foros del Web » Programando para Internet » PHP »

Problema impresion con php!

Estas en el tema de Problema impresion con php! en el foro de PHP en Foros del Web. Hola de nuevo a todos!! Escribi un script php para consultar la visibilidad, rango de pagina, etc a un sitio en el que solo tengo ...
  #1 (permalink)  
Antiguo 06/01/2012, 09:16
Avatar de adrianjoselarac  
Fecha de Ingreso: julio-2011
Ubicación: Inframundo
Mensajes: 23
Antigüedad: 12 años, 9 meses
Puntos: 0
Problema impresion con php!

Hola de nuevo a todos!!

Escribi un script php para consultar la visibilidad, rango de pagina, etc a un sitio en el que solo tengo que enviar la consulta por medio de una url y el me devuelve un xml con el resultad, el problema es que cuando por ejemplo el archivo csv donde tengo todos los dominios a consultar contiene 800 o mas me imprime solo una parte de los resultados(unos 300 - 400) luego no me imprime nada pero el Script sigue corriendo. Alguien tiene alguna idea de que puede ser? aca pongo el codigo:

Código:
<?php
error_reporting(0);
set_time_limit(1);
$methoden=array(

				0 => array(
								'name' => 'Sichtbarkeit',
								'abfrage' => 'sichtbarkeitsindex',
								'url'    => 'http://api.sistrix.net/domain.sichtbarkeitsindex?api_key='
						),
				
				1 => array(
								'name' => 'Domain - pop',
								'abfrage' => 'Domain - pop',
								'url' => 'http://api.sistrix.net/links.overview?api_key='
						)
				);	
				
$sistrixApiKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";

function getDomainSichtbarkeitsindex($apiKey, $domain)
{
	// $requestUrl = "http://api.sistrix.net/domain.sichtbarkeitsindex?api_key=$apiKey&domain=$domain";
	// $xml = simplexml_load_file($requestUrl);
	// $sichtbarkeitsindex = xml2array($xml->answer->sichtbarkeitsindex['value']);		
	//return $sichtbarkeitsindex;
	
	for($i=0; $i<sizeof($GLOBALS['methoden'])-1;$i++)
	{
		$requestUrl = $GLOBALS['methoden'][$i]['url'].$apiKey."&domain=".$domain;
		$xml = simplexml_load_file($requestUrl);	
		if($i==0)
		{
			$val1=xml2array($xml->answer->sichtbarkeitsindex['value']);
			print "<td align='center'>".$val1[0]."</td>";
			
		}
		if($i==1)
		{
			$val2=xml2array($xml->answer->domains['num']);
			$val3=xml2array($xml->answer->total['num']);
			$val4=xml2array($xml->answer->hosts['num']);
			print "<td align='center'>".$val3[0]."</td>"."<td align='center'>".$val4[0]."</td>"."<td align='center'>".$val2[0]."</td>";
		}
	}	
	
}

function xml2array($xmlObject, $out = array())
{
	foreach( (array) $xmlObject as $index => $node)
	{
		$out[$index] = ( is_object ($note) ) ? xml2array ($node) : $node;
	}
	
	return $out;
}

$t67Data = "";

$path = "C:/xampp/htdocs/test/Skript";
 
$dir_handle = @opendir($path) or die("Unable to open $path");
$files=0;
$k=1;
$counter=0;

while ($file = readdir($dir_handle))
{
   $ver="Sistrixwerte".$k."_01_11_2011.csv";   
   if(file_exists($ver))
   {
		if(($csvFile = fopen($ver, "r")) !== FALSE)
		{
			$j=1;
			print "<table border='0' width='40%'>";
			print "<tr><td colspan='4' align='center'>File: ".$ver."</td></tr>";
			print "<tr><td>Num.</td><td align='center'>Domains</td><td align='center'>Sichtbarkeit</td><td align='center'>Total Links</td><td align='center'>Host-pop</td><td align='center'>Domain-pop</td>";
			while(($csvData = fgetcsv($csvFile,1000)) !== FALSE)
			{
				$num = count($csvData);
					for($c = 0; $c < $num; $c++)
					{
						print "<tr><td align='center'>".$j."</td><td><strong>".$csvData[$c]."</strong></td>";
						$data=getDomainSichtbarkeitsindex($sistrixApiKey,$csvData[$c]);
						$j++;
						$counter++;
					}				
			
			}
			print "</td></tr>";
			print "</table>";
			print "<hr>";
			fclose($csvFile);
		}
	}
	$k++;
}
closedir($dir_handle);
?>
Saludos y gracias por su ayuda.

Etiquetas: impresion
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 04:55.