I am working on a website with PHP as backend. There are things from the front-end which I'd like to accomplish using AJAX calls.
Which of these methods should I use to design them and why?
Call to different PHP files for different uses
Call to the same PHP file, with instructions on what to do
A RESTful API
Any other better way?
require('like.php')
or comment.php to handle the specifics. Thus AJAX.php has one purpose: handle request, but you only need to handle requests in the one file.