Get variable javascript and put in php [duplicate]

1

How do I get a variable sent by the input in javascript to php? I searched the net bad is not working. Thanks guys!

JAVASCRIPT:

<script>
    funcaoJavascript = function(){
var valor = document.getElementById('id1').value;

}

</script>

PHP and the input:

<input type="text" id="id1" onchange="funcaoJavascript()"/>
<?php $x = "script>document.write(valor)</script>";
echo $x;
?>
    
asked by anonymous 03.12.2016 / 22:01

0 answers