Take variable javascript and put in php

Asked

Viewed 881 times

1

How do I get a variable sent by input in javascript to php? I looked it up online, but it’s not working. Personal thank you!

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;
?>
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.