1
I am making a password system in which the attendant can enter the password number and call a customer through a panel. The code you sent me works but not as I expected.. I need to update a page that will be working through the other page, I need the form I sent to himself and run an event on the other page that will be running
The code is working but I need to give a F5 in the whole page for the variable to update. I need to send some event to update and execute a javascript code that is a sound.
Form in which I update the variable:
<?php
session_start();
if(!empty($_POST['senha'])){
$senha = $_POST['senha'];
$_SESSION['senha'] = $senha;
}
else
$senha = 0000;
?>
<!DOCTYPE html>
<html>
<body>
<form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post">
<input type=text name="senha"/>
<button>Enviar</button>
</form>
</body>
</html>
Page that receives the variable:
<?php
session_start();
$senha = $_SESSION['senha'];
?>
<html>
<?php echo $senha; ?>
</html>
code sound:
<script>
function Senha(){
var audio1 = new Audio();
audio1.src = "sound/senha.mp3";
audio1.play();
}
</script>
Thanks in advance..
Possible duplicate of How to use ajax and php to call a function in php?
– Pedro Augusto
I already read this post but does not clarify my doubt
– MStefani