Ver Mensaje Individual
  #36 (permalink)  
Antiguo 03/12/2012, 09:26
Avatar de satjaen
satjaen
 
Fecha de Ingreso: septiembre-2012
Ubicación: Jaén (Andalucía)
Mensajes: 893
Antigüedad: 12 años, 5 meses
Puntos: 10
Respuesta: No me lleva a la pagina.

Cita:
Iniciado por jmdearpe Ver Mensaje
Pero sigues teniendo error de conexión a la base de datos en el php?

Es que si tienes error de conexión lo tienes que resolver sino de momento no te funcionará.
De todas formas te añado una cosa que tb faltaba:
Código HTML:
function GuardaFormulario()
{
    var TELEFONO = document.forms['form1'].elements['TELEFONO'];
    if (TELEFONO.value.length == 0)
    {

        alert("Insertar el Teléfono");

        TELEFONO.focus();

        return 0;

    }
    else
    {
        if (window.XMLHttpRequest)
        {
            xmlhttp=new XMLHttpRequest();
        }
        else
        {
            xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
        xmlhttp.open("GET", "valida1.php?TELEFONO=" + TELEFONO.value, true);
        xmlhttp.send();    
        if (xmlhttp.readyState==4 && xmlhttp.status==200)
    
        {
            var xml = xmlhttp.responseXML;
            dato=xml.getElementsByTagName("datos");
            if(dato[0].firstChild.nodeValue=="1")
            {
                num_user=xml.getElementsByTagName("numusuario");
                var boton = confirm("¡Usuario existente!¿Desea hacer un nuevo registro?");    
                if (boton)
                { 
                    window.location.href = "menu3.php?id="+num_user[0].firstChild.nodeValue;
                } 
                else 
                {  
                    window.location.href = "menu4.php";      
                }
            }
            if(dato[0].firstChild.nodeValue=="0")
            {                   
                alert("¡El Cliente se ha dado de alta!");      
                document.forms['form1'].submit();////Aquí mando el formulario si el teléfono no existe.
            } 
        }
    }
}
Buenas, el php ya funciona bien y he probado esto último y sigue igual.
Como recibe el archivo js la RESPUESTA DEL PHP?