tengo el siguiente problema.
Cuando yo intento recuperar del servidor(pagina.php) un numero, lo recupero bien, ahora cuando quiero recuperar un string , me devuelve nulo.
Codigo
<?php
header('Content-Type: text/xml');
include_once("db.php");
$funcion=$_GET["funcion"];
if ($funcion == "carpeta")
{
$carpeta=$_GET["carpeta"];
$db=db_connect();
$query = "select * from usuario where user='".$carpeta."'";
$result = mysql_query($query, $db) or die (mysql_error());
if (mysql_num_rows($result)>0)
{
$result="<img src='carita1.bmp' />";
}
else
{
$result=1;
}
echo "<?xml version=\"1.0\"?><resultado>".$result."</resultado>";
?>
Si entro a la pagina yo por el link, la pagina xml es correcta, me muestra los valores y todo, pero cuando lo recupero con javascript me devuelve nulo, aca el codigo javascript
Código HTML:
 function pedir_info(myurl,id,tag) {
  //  var myurl = 'comprobar_usuario.php';
  myRand = parseInt(Math.random()*999999999999999);
  var modurl = myurl+"&rand="+myRand;
  http.open("GET", modurl, true);
  http.onreadystatechange = onredyestatechange = function() { comprobarExistencia(id,tag) };;
  http.send(null);
}
function comprobarExistencia(id,tag) {//1
   
   if (http.readyState == 4) {//2
    if(http.status == 200) {//3
	    var result = http.responseXML.getElementsByTagName(tag)[0];
		var result= result.childNodes[0].nodeValue;
		alert(result);
	   document.getElementById(id).innerHTML = result;
     }//3
	  else {//4
		alert("Ha ocurrido un error: " + miPeticion.statusText);
        }//4
    } //2
	else {//5     // si readyState ha cambiado
                 // pero readyState <> 4
           // aca puedo agregar argo mientras espero el resultado document.getElementById('esperando').innerHTML = '<img src="anim.gif">'+a;
    }//5
}//1
 
 

 
 
