"how to pass jquery variables to php variable?" Answer’s

0

Ajax can do this. Google it, and check out api.jquery.com and look at the ajax functions, .ajax(), .post(), .get(), .load(), etc.

As for your specific question, here is what you would do:

//Javascript file
$("input[type=checkbox]").click(function () {
   $.post('my_ajax_receiver.php', 'val=' + $(this).val(), function (response) {
      alert(response);
   });
});

//PHP file my_ajax_receiver.php
<?php
   $value = $_POST['val'];
   echo "I got your value! $value";
?>
Wednesday, March 31, 2021
 
Skipper
answered 10 Months ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :