I am trying to learn php and js. Here I am trying to put a value in php varible from javascript alert message input box but failed.
here what I have done so far,
// <?PHP and other variable is here....
$number='number';
<script>
function number{
if (fail == "") {
number = prompt('Please enter Phone Number')
if (number == "" || number == null) {
alert(' You have not specified the Phone Number. Please try again.');
return false;
}
else {
document.getElementById("number").value;
return true;
}
}
else { alert(fail); return false; }
}
</script>
So, actually how I can store the value from js alert to php varible? help me. Thanks for your valuable time and opinion.