javascript - Using AJAX data / variables to target a specific PHP Switch: Case (Run a PHP switch from AJAX) -
part of oauth program writing involves updating information database linked single php file. php file has simple switches so
switch ($server_functions) { case "recover": //function() $full_name = $_post['full_name']; break; case: "register": //function() break; }
how target 1 specific switch using ajax function? using jquery far, each switch has own list of variables posting jquery. far seperating php switches mini files has been fruitful , seem work well, thats not bosses want. how can guys save job?
ajax:
var data = { "switch": "recover" }; $.ajax({ type: "post", datatype: "json", url: "response.php", //relative or absolute path response.php file data: data, success: function(data) {
Comments
Post a Comment