Código:
PHP: Función que muestra la información en formato XMLfunction montarAgencia(qS){ var loadVars = new LoadVars(); loadVars.ignoreWhite = true; loadVars.tipo = qS; loadVars.sendAndLoad("agenciaXML.php", loadVars, "POST"); loadVars.onLoad = function(exito){trace(this)} }
Código:
Cuando le pido que me trace lo que cargue me muestra<?php require_once "maincore.php"; if(isset($_POST['tipo'])){ $res = dbquery("SELECT * FROM agencia WHERE tipo=".$_POST['tipo']); } else { $res = dbquery("SELECT * FROM agencia"); } header("Content-type: text/xml"); echo "<?xml version='1.0' encoding='iso-8859-1'?>\n<agencia>\n"; while ($data = dbarray($res)) { echo "\t <persona id='".$data['idPersona']."' nombre='".$data['nombre']." />\n"; } echo "</agencia>"; ?>
Cita:
nada más empezar está "require_once..." por lo que me está cargando el PHP tal cual cuando yo quiero que me muestre solo la parte "echo".%3C%3F%0D%0Arequire%5Fonce%20%22maincore%2Ephp%22% 3B%0D%0A%0D%0Aif%28isset%28%24%5FGET%5B%27tipo%27% 5D%29%29%7B%0D%0A%09%24res%20=%20dbquery%28%22SELE CT%20%2A%20FROM%20agencia%20WHERE%20tipo%3D%22%2E% 24%5FGET%5B%27tipo%27%5D%29%3B%0D%0A%7D%20else%20% 7B%0D%0A%09%24res%20%3D%20dbquery%28%22SELECT%20%2 A%20FROM%20agencia%22%29%3B%0D%0A%7D%0D%0A%0D%0Aec ho%20%22%3C%3Fxml%20version%3D%271%2E0%27%20encodi ng%3D%27iso%2D8859%2D1%27%3F%3E%5Cn%3Cagencia%3E%5 Cn%22%3B%0D%0Awhile%20%28%24data%20%3D%20dbarray%2 8%24res%29%29%20%7B%0D%0A%09echo%09%22%5Ct%20%3Cpe rsona%20id%3D%27%22%2E%24data%5B%27idPersona%27%5D %2E%22%27%09sexo%3D%27%22%2E%24data%5B%27sexo%27%5 D%2E%22%27%09tipo%3D%27%22%2E%24data%5B%27tipo%27% 5D%2E%22%27%09nombre%3D%27%22%2E%24data%5B%27nombr e%27%5D%2E%22%20%22%2E%24data%5B%27apellidos%27%5D %2E%22%27%09foto%3D%27%22%2E%24data%5B%27foto%27%5 D%2E%22%27%09altura%3D%27%22%2E%24data%5B%27altura %27%5D%2E%22%27%09cintura%3D%27%22%2E%24data%5B%27 cintura%27%5D%2E%22%27%09ojos%3D%27%22%2E%24data%5 B%27ojos%27%5D%2E%22%27%20%2F%3E%5Cn%22%3B%0D%0A%7 D%0D%0Aecho%20%22%3C%2Fagencia%3E%22%3B%0D%0A%3F%3 E&onLoad=%5Btype%20Function%5D&tipo=0&ignoreWhite= true
¿Qué estoy haciendo mal?
Gracias