
29/01/2012, 08:34
|
| | Fecha de Ingreso: enero-2010
Mensajes: 97
Antigüedad: 15 años, 1 mes Puntos: 3 | |
mandar variables post por ajax, NO LLEGAN!! Buenos dias, tengo un problemilla y no se donde falla, el problema es que al hacer una llamada ajax, el php que lo recibe no me reconoce las variables POST que le paso. este es el codigo
javascript:
--------
function createAjax()
{
var xmlhttp=false;
try
{
// Creacion del objeto AJAX para navegadores no IE
xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
try
{
// Creacion del objet AJAX para IE
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(E) { xmlhttp=false; }
}
if (!xmlhttp && typeof XMLHttpRequest!="undefined") { xmlhttp=new XMLHttpRequest(); }
return xmlhttp;
}
function executeAjax()
{
var ajax = createAjax();
ajax.open("POST", "/php_functions/ajax.php", false);
ajax.send('func=laquesea&id=1');
return ajax.responseText;
}
------------
en el php tengo esto:
$function = $_POST['func'];
$id = $_POST['id'];
y no las recibe, cuando les hago un echo, no muestra nada.
por favor,¿donde esta el error? |