Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

107
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!