calling a php function in javascript
I dont know how to use ajax in my problem: I have a function in php (assign) that update a temporary table in database, I want to when user user click on a button (feedback function that is defined in javascript) this function (assign) run, what should I do? <script> function feedback(){ var boxes = document.getElementsByClassName('box'); for(var j = 0; j < boxes.length; j++){ if(boxes[j].checked) { assign(1); } else{ assign(0); } } } </script> <?php $con = mysql_connect("localhost", "root", "") or die(mysql_error()); if (!$con) { die('Could not connect to MySQL: ' . mysql_error()); } mysql