Topic: call a php web -> assign("mensaje","innerHTML",web.php);

hi xajax users

In ajax i do this:

ajax.open("POST", "web.php",true);....

but in xajax how i do that.....i want to show a php file.. in a div tag  ok...
if that is easy sorry jeje i'm a Newbie tongue

Thank...

Last edited by dbzsoft (2009-07-06 5:29:16 PM)

Re: call a php web -> assign("mensaje","innerHTML",web.php);

Please I need this answer......

How i do this in xajax?

$respuesta->assign("mensaje","innerHTML",web.php);


how do i this?

function enviarDatosBiblio(){
  //donde se mostrará lo resultados
  divResultado = document.getElementById('resultado');
  divResultado.innerHTML= '<img src="investigacion/grupos/anim.gif">';
  //valores de las cajas de texto
 
  ac1=document.nuevo_grupo.ac1.value;
  tm1=document.nuevo_grupo.tm1.value;
  anio=document.nuevo_grupo.anio.value;
  vol2=document.nuevo_grupo.vol2.value;
  tit=document.nuevo_grupo.tit.value;
   
  //instanciamos el objetoAjax
  ajax=objetoAjax();
  //uso del medoto POST
  //archivo que realizará la operacion
  //registro.php
  ajax.open("POST", "biblioteca/mb/registro.php",true);
  ajax.onreadystatechange=function() {
  if (ajax.readyState==4) {
  //mostrar resultados en esta capa
  divResultado.innerHTML = ajax.responseText
  //llamar a funcion para limpiar los inputs
  LimpiarCampos();
  }
  }
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  //enviando los valores
  ajax.send("ac1="+ac1+"&tm1="+tm1+"&anio="+anio+"&vol2="+vol2+"&tit="+tit)
}

Re: call a php web -> assign("mensaje","innerHTML",web.php);

The third parameter is where you must put the text result of your php file for your example. You can use file_get_contents or ob_start to get the contents of your file and the put it in the third parameter.

Last edited by Gurthgor (2009-07-10 2:52:56 PM)

Re: call a php web -> assign("mensaje","innerHTML",web.php);

i don't know if this code below can help you out of not:

php code :

$res = new xajaxResponse();

ob_start();

include('web.php');//your php file

$str= ob_get_clean();

$res ->assign('result','innerHTML',$str);


return $res;