Answer the question
In order to leave comments, you need to log in
How to transfer a variable from jquery to php?
$('input[name="radioName"]:checked').val();
For example, how to assign this value to the php / variable
Answer the question
In order to leave comments, you need to log in
It must be sent using the POST or GET method. I would choose POST, the code would look like this:
$("#radio").click(function(){
$.post("doc.php", {cokie:$("#radio").val()});
});
<?php
$radio = htmlspecialchars(strip_tags($_POST['radio']));
?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question