I am beginner on coding I need help on passing jquery variable to php inside the same jquery
<script language="javascript">
$(document).ready(function(){
$("#option1).change(function(test));
$("#option2).change(function(test));
function(test){
var select1 = $("select1").val();
var select2 = $("select2").val();
var phpselect1 = '<?php $select1 = '+select1+'?>';
var phpselect2 = '<?php $select2 = '+select2+'?>';
}
});
</script>
I want to pass the the jquery variable to php in this way but I can't pass it anyway. Is there any way to pass the variable like this to php? please help me. ...