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 ^_^
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>