Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

101
Vistas
the button is inactive after successfully moving the page and when returning to the page where the button is still inactive

how to make the button is inactive after successfully moving the page coba.php and when returning to the page test.php button remains inactive

test.php

`<button type="button" id="Btn" onclick="myFunction()">Klik</button>
<script>
 function myFunction() 
   {var x = document.getElementById("Btn");location.href =   
            "coba.php";x.disabled = true;}
</script>`

this file coba.php

<?php echo "Hallo!" ?>

Thank you in advance ^_^

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If I understand correctly you want that after the file has been moved successfully you want the button to be disabled

if this is the case, one possible way is to use a variable of type sesssion and check if the page has already been visited as in this example:

test.php:

<?php
session_start();
?>
<html>
 <body>
   <button onClick="myfunction()" 
   <?php if(isset(session['load'])){echo("disabled");}?>
   >Klik</button>
   <script>
     function myfunction(){
        location.href = "coba.php";}
   </script>
 <body>
<html>

the coba.php look like this:

<?php
session_start();
$_SESSION['load'] = "true";
?>
<html>
 <body>
   <?php echo("Hallo!") ?>
   <a href="./index.php"><button>Back</button></a>
 <body>
<html>
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda