Ver Mensaje Individual
  #1 (permalink)  
Antiguo 24/01/2013, 12:21
Avatar de Capimaster
Capimaster
 
Fecha de Ingreso: agosto-2004
Mensajes: 494
Antigüedad: 19 años, 8 meses
Puntos: 2
Problema con DOMDocument

Tengo este codigo....
Código PHP:

<?php

$doc 
= new DOMDocument();
libxml_use_internal_errors(true);
$doc->loadHTMLFile('http://www.muyinteresante.com.mx/index.html'); 
$xpath = new DOMXPath($doc);
$peliculas $xpath->query('//div[@class="carrusel_home"]//a');
$caption $xpath->query('//div[@class="nivo-html-caption"]');
?>

<div id="stage2">
            <div id="cont_slider">
                <div id="slider" class="carrusel_home" style="-moz-box-shadow:none;">

<?php
$e 
1;
for (
$i 0$i $peliculas->length$i++) {
   
    
    echo 
'<a target="_blank" href="'.$peliculas->item($i)->getAttribute('href').'" title="'.$peliculas->item($i)->getAttribute('title').'" ><img src="'.$peliculas->item($i)->getElementsByTagName('img')->item(0)->getAttribute('src').'" width="588" height="257" alt="'.$peliculas->item($i)->getAttribute('title').'" title="#htmlcaption_stg_'.$e.'" /></a>';


?>    <div id="htmlcaption_stg_<?php echo $e ?>" class="nivo-html-caption"><h1><?php echo $caption->item($i)->getElementsByTagName('h1')->item(0)->nodeValue?></h1><?php echo $caption->item($i)->lastChild->nodeValue?></div>                           
                    
                    <?php
$e
++;                            
 }
?>
 
                </div>
               </div>
</div>
me funciona bien.....
http://www.elcapitolio.com.mx/prueba...nteresante.php

perooo en la consolo de errores....
me esta marcando esto todo el tiempo

[Thu Jan 24 13:15:44 2013] [error] [client 187.204.84.242] File does not exist: /home3/elcapito/public_html/pruebas/undefined, referer: http://www.elcapitolio.com.mx/prueba...nteresante.php

que podra ser?
__________________
http://www.elcapitolio.com.mx - Ocotlán, Jalisco, México

Última edición por Capimaster; 24/01/2013 a las 12:22 Razón: codigo