This is a best practice / structure question:
I’ve built a mini cms and use AJAX to process the actions to the database (a/e/d items for example). The way I currently have this setup is a single process.php file with a case call and in the JQ AJAX call, I define the action as below:
$.post("inc/process.php", {page: "add_page", form:
$('#form').serialize(),}, function(data){...});
my question is, is using case and grouping these items on a single process.php file the best way to go about this, or should I be structuring this with Classes and functions to call the various actions?
You are correct to do it as you did because the code is reusable and therefore is easier to change. However, if the data transitioning gets a little larger, you would want to look at separating things a little more.