I dont know if this is possible but i want to ask if its possible to save a users input from a javascript pop up form into a php variable. For example in this code provided by w3schools the user input is displayed on the screen, instead of this how do i save it to a variable in php. The source code of the example is the following
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript Prompt</h2>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var txt;
var person = prompt("Please enter your name:", "Harry Potter");
if (person == null || person == "") {
txt = "User cancelled the prompt.";
} else {
txt = "Hello " + person + "! How are you today?";
}
document.getElementById("demo").innerHTML = txt;
}
</script>
</body>
</html>
What i have to learn in order to be able to do that? Thanks in regards