Ajax file organization best practices

laurasaopaulo

New Member
I have a PHP based web page. Using Ajax, I call PHP routines. Is it a better practice to keep each routine on its own separate file. Or would it be better to keep them all in one file and the divide the file using a $_GET variable. Example:
\[code\]if($_GET['AjaxFunction'] == 1) {
...
} elseif($_GET['AjaxFunction'] == 2) {
...
} elseif($_GET['AjaxFunction'] == 3) {
...
}\[/code\]
 
Back
Top