Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

161
Visualizações
Function goes to recursive mode on submit

I am getting username and password through queryparams and showing that data in input field of PHP website and using JavaScript to show dashboard instead of login page. But website goes to recursive mode when directly calling login button function, for that I am using alert to stop for 2 seconds. Is it possible to directly get that data and show dashboard.

echo ' Username ---> ' .$_GET['xuser_name'];
echo ' password ---> ' .$_GET['xuser_password'];

$str .= getFormRowTextInput('xuser_name', $l['w_username'], $l['h_login_name'], '', $username, '', 255, false, false, false, '');
   
$str .= getFormRowTextInput('xuser_password', $l['w_password'], $l['h_password'], '', $password, '', 255, false, false, true, '');

$str .= '<input type="submit" name="login" id="login" value="'.$l['w_login'].'" title="'.$l['h_login_button'].'" />'.K_NEWLINE;
<script>

   window.onload = function(){
              
document.getElementById('login').value="anuj";
  
    document.getElementById("login").onclick = async function(event) {
        event.preventDefault();
        var button = document.getElementById('login');
        await button.form.submit();
  
       var currentLocation = window.location;
       console.log("test",currentLocation.href);
         setInterval(alertFunc, 2000);
if(!(currentLocation.href.includes("logout=1"))){
     
} 
  return true;
}
document.getElementById('login').click();
 }
   
   function alertFunc() {
 alert("You are Redirected to TCEXAM")
 console.log("Clicked");
   var button = document.getElementById('login');
  button.form.submit();
 }

</script>
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0


   window.onload = function(){
              
// document.getElementById('login').value="anuj";
  
    document.getElementById("login").onclick = function(event) {
  event.preventDefault();
  var currentLocation = window.location;
  console.log("test",currentLocation.href);
if(!(currentLocation.href.includes("logout=1"))){
    // console.log("test",currentLocation.href);
    // console.log("Clicked");
  var button = document.getElementById('login');
  button.form.submit();
    //  setInterval(alertFunc, 2000);
} else if(currentLocation.href.includes("logout=1")){
    //console.log("test",currentLocation.href);
//    alert("Logged Out");
}else{
    alert("Wrong Username and Password");
    console.log("Wrong Username and Password");
}

  return true;
}
document.getElementById('login').click();
 }

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda