¡@

Home 

2014/10/16 ¤W¤È 12:09:59

jquery Programming Glossary: useranswer

Using AJAX to pass variable to PHP and retrieve those using AJAX again

http://stackoverflow.com/questions/15637101/using-ajax-to-pass-variable-to-php-and-retrieve-those-using-ajax-again

.ajax url 'ajax.php' data dataType 'json' success function data1 var y1 data1 console.log data1 PHP CODE php userAnswer _POST 'name' echo json_encode userAnswer php javascript jquery ajax share improve this question Use dataType json.. 'json' success function data1 var y1 data1 console.log data1 PHP CODE php userAnswer _POST 'name' echo json_encode userAnswer php javascript jquery ajax share improve this question Use dataType json for json data .ajax url 'ajax.php' This is.. json data name 145 success function data console.log data Read Docs http api.jquery.com jQuery.ajax Also in PHP php userAnswer _POST 'name' sql SELECT FROM tablname where color ' . userAnswer. ' result mysql_query sql row mysql_fetch_array result..

PHP + Jquery - pass value through ajax to php and check against variable

http://stackoverflow.com/questions/4218063/php-jquery-pass-value-through-ajax-to-php-and-check-against-variable

through ajax and get the php to grab it check it matches and add 1 to score. This is the code I've written php score 1 userAnswer _POST 'name' if _POST 'name' 145 score else Do nothing echo score script type text javascript document .ready function #raaagh.. location.reload from your success handler. ajax.php Outputs 2 if the name parameter is 145 1 otherwise php score 1 userAnswer _POST 'name' if _POST 'name' 145 score echo score test.html script type text javascript document .ready function #raaagh..