Ajax in JavaScript to pass to PHP
I’m using radio buttons (‘countries’) to open dropdown-box of its corresponding ‘cities’.
The variable ‘radioPressed’ detects the selected radio button and I need to pass its value inside my JavaScript to a PHP, as follows:
Code:
<script>
var radioPressed = 123;
<?php $what_is_myVar = radioPressed ; ?>
</script>
Since the solution can be complicated, I would ask to receive an advice only regarding the main steps of how to pass the value of 'radioPressed' into $what_is_myVar
Thanks a lot for any assistance,