My PHP pages all contain "actions". At the top of each page is something like:
$action = $_GET['action'];
if ($action) {$action == $action) {
Then, all throughout the rest of the page are the action's defined:
if ($action == "edit") {
$dosomething = "here";
}
So, I try to keep all my functions and actions on one (very long) page. It's my crazy way of organizing and keeping files separated.
So, here's my question(s): Is this a good idea? I have a couple of PHP files that are easily 38KB. Does the user have to download all 38KB worth of data? Or does PHP only send the user the data he/she needs? I know that PHP just passes over the "ifs" that are irrelevant, or the functions that aren't called. But will this coding practice make my pages slow? And cause the user to download large amounts of data with each page load?
Thanks in advance for your advice...