Obtengo el nombre de usuario y la contraseña a través de queryparams y muestro esos datos en el campo de entrada del sitio web de PHP y uso JavaScript para mostrar el panel en lugar de la página de inicio de sesión. Pero el sitio web pasa al modo recursivo cuando llama directamente a la función del botón de inicio de sesión, para eso estoy usando alerta para detenerme durante 2 segundos. ¿Es posible obtener directamente esos datos y mostrar el tablero?
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>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(); }