Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/06/2011, 16:47
alvarols
 
Fecha de Ingreso: diciembre-2008
Mensajes: 738
Antigüedad: 15 años, 4 meses
Puntos: 15
SimpleXML no funciona en el servidor

Tengo un código para leer feeds que me funciona perfecto en localhost, pero al subirlo al servidor no funciona. El problema es que el PHP ni siquiera me tira ningún error. Ya le dí phpinfo() y me dice que el simplexml está activado.

Este es el código.

Código:
<?php $data = simplexml_load_file('http://www.propuestaciudadana.org.mx/?feed=rss2'); ?>

        <?php
 /* Make a title for this page taken from the feed title */ ?>


<?php
/**
 * Now loop through the channel items to get the item information. Because
 * SimpleXML implements the countable and iterator interfaces we can loop
 * over just about any SimpleXML element recursively.
 * 
 * For styling, we are going to alternate row color
 */
// Set the row coloring flag
$color = true;
 
// Loop the feed items
foreach ($data->channel->item as $item):
?>
<?php /* Handle row color switching */ ?>
<div class="feed-item row<?php if ($color): ?>-on<?php endif; ?>">
	<?php /* Make a title for this item, linking back to its original source*/ ?>
	<p><a href="<?php echo $item->link ?>"><?php echo $item->title ?></a></p>
	<?php /* Show the body of the item with the publication date */ ?>
</div>
<?php /* Reset the row colorizer as needed */ ?>
<?php $color = !$color; endforeach; ?>