Jump to content

What does this mean? Someone who can understand it.


Recommended Posts

Posted

// Define variável global

var xmlhttp;

 

function __mudaSenha(varForm) {

 

// Atribui valores as variáveis

var usuario = document.getElementById('usuario').value;

var senha = document.getElementById('senha').value;

var novasenha = document.getElementById('novasenha').value;

var renovasenha = document.getElementById('renovasenha').value;

 

   // Instancia o objeto, dependendo do navagador

   if (window.XMLHttpRequest) {

 xmlhttp = new XMLHttpRequest();  

   } else if (window.ActiveXObject) {

  xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");  

   } else {

 alert("Seu navegador não suporta XMLHttpRequest. Atualize seu navegador");

 return;

   }

 

   xmlhttp.open("POST", "acc_change_password/changePassword.php", true);    

 

   xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");

   xmlhttp.setRequestHeader("Cache-Control", "no-store, no-cache, must-revalidate");

   xmlhttp.setRequestHeader("Cache-Control", "post-check=0, pre-check=0");

   xmlhttp.setRequestHeader("Pragma", "no-cache");

   

   xmlhttp.onreadystatechange = processReqChange;

 

   xmlhttp.send("usuario=" + usuario + "&senha=" + senha + "&novasenha=" + novasenha + "&renovasenha=" + renovasenha);

}

 

 

function processReqChange() {

 

   document.getElementById("resp").innerHTML = "Processing Data...";

   if (xmlhttp.readyState == 4) {    

if (xmlhttp.status == 200) {

 // xmlhttp.responseText, recebe o valor da variavel $msg de cadastro.php

   if(xmlhttp.responseText == 1) {

document.getElementById("resp").innerHTML = "Password Changed ! ! ! <br><br><br>";

window.location.href = "http://www.l2reliance.net/br";    // Redireciona para uma pagina....

} else

document.getElementById("resp").innerHTML = xmlhttp.responseText;

       } else {

           alert("Problems on data load.");

       }

   }

 

}

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..