Comunidad de diseño web y desarrollo en internet online

flash, php, xml y mysql... no muestra contenido

Citar            
MensajeEscrito el 10 Feb 2010 01:05 pm
Hola gente, tengo una web que carga la info desde un xml creado con php que trae la info de una base de datos mysql.
En mi PC funciona hermoso, en el hosting no, cuando veo el php que genera el xml NO da ningún error y muestra todos los datos, pero el flash queda en blanco. Lo que carga es texto. Qué puede ser? Les dejo los códigos:

CALENDARXML.PHP

Código PHP :

<?php
//header("Content-type: text/xml");
echo '<?xml version="1.0"?>';

include ("includes/config.php");
include ("includes/funciones.php");

$cnx = conectar();

$sql = "SELECT * FROM calendar ORDER BY id ASC";
$res = mysql_query($sql) or die("output=error&msg=".mysql_error());

if(mysql_num_rows($res) > 0)
{
   echo "<calendar>";
   
   //parseamos la información guardándola en $salida.
   while($fila = mysql_fetch_array($res))
   {
       $salida.= "<fecha>";
         $salida.= "<dia>" . $fila['fecha'] . "</dia>";
          $salida.= "<correo>" . $fila['hora'] . "</correo>";
          $salida.= "<cuerpo>" . utf8_encode($fila['lugar']) . "</cuerpo>";
          $salida.= "<remitente>" . utf8_encode($fila['zona']) . "</remitente>";
      $salida.= "</fecha>";
      
   }

   //imprimimos la salida.
   echo $salida;
   
   echo "</calendar>";
   
   //liberamos memoria
   mysql_free_result($res);
   //cerramos la conexión
   mysql_close($cnx);
   //detenemos la ejecucion de la pagina.
   exit;
}
?>


ARCHIVO.FLA

Código ActionScript :

var myXML:XML = new XML();
myXML.ignoreWhite=true;
myXML.load("http://localhost/rusconi/calendarxml.php");
myXML.onLoad = function(success) 
{
   if (success) 
   {
      var myImage = myXML.firstChild.childNodes;
      for (i=0; i<myImage.length; i++) 
      {
         var myImage2 = myXML.firstChild.childNodes[i].childNodes;
         dia = myImage2[0].firstChild.nodeValue;
         hora = myImage2[1].firstChild.nodeValue;
         lugar = myImage2[2].firstChild.nodeValue;
         zona = myImage2[3].firstChild.nodeValue;
         
         mitexto.html = true;
         mitexto.htmlText += dia + "  " + hora + "   " + " <b>" + lugar + "</b>" + "  //" + zona;
         /*
         for (j=0; j<myImage2.length; j++)
         {
            var imageNumber = j+1;
            var imageURL = myImage2[j].firstChild.nodeValue;
            trace ("ID"+imageNumber+" : "+imageURL)
            mitexto.text += "  " + imageURL;
         }
         */
         mitexto.htmlText += "\n";        
      }      
   }   
};


Gracias.
Salut y vita!
Emiliano

Por boratlon

Claber

139 de clabLevel



 

msie7
Citar            
MensajeEscrito el 10 Feb 2010 01:16 pm
Otro detalle que no entiendo... estoyusando el mismo codigo para generar el xml pero con datos de otra tabla, mientras que calendarxml.php si lo ejecuto me muestra un xml en pantalla, pressxml.php me muestra texto de corrido, por qué es esto? les dejo el php. Gracias.

Código PHP :

<?php
//header("Content-type: text/xml");
echo '<?xml version="1.0"?>';

include ("admin/config.php");
include ("admin/funciones.php");

$cnx = conectar();

$sql = "SELECT * FROM press ORDER BY id ASC";
$res = mysql_query($sql) or die("output=error&msg=".mysql_error());

if(mysql_num_rows($res) > 0)
{
   echo "<press>";
   
   //parseamos la información guardándola en $salida.
   while($fila = mysql_fetch_array($res))
   {
       $salida.= "<noticia>";
         $salida.= "<texto>" . utf8_encode($fila['texto']) . "</texto>";
          $salida.= "<linkurl>" . $fila['linkurl'] . "</linkurl>";
          $salida.= "<linktxt>" . utf8_encode($fila['linktxt']) . "</linktxt>";
      $salida.= "</noticia>";
      
   }

   //imprimimos la salida.
   echo $salida;
   
   echo "</press>";
   echo "</xml>";
   
   //liberamos memoria
   mysql_free_result($res);
   //cerramos la conexión
   mysql_close($cnx);
   //detenemos la ejecucion de la pagina.
   exit;
}
?>


Abrazos! Emiliano

Por boratlon

Claber

139 de clabLevel



 

msie7
Citar            
MensajeEscrito el 10 Feb 2010 04:38 pm
Claro! que bobo soy... la URL!!! LA URL!!!!

Por boratlon

Claber

139 de clabLevel



 

msie7
Citar            
MensajeEscrito el 10 Feb 2010 07:36 pm
esas confusiones boludas me pasan a mi tambien todo el tiempo jaja :twisted:

Por luco

Claber

110 de clabLevel



Genero:Masculino  

chrome

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.