1. Right now I'm taking advantage of the include function of PHP so I can increase the robustness of my site navigation (I tend to have a brainstorm half way through every now and then) and I really don't like the usage of Frames.
I noticed it was getting really tedious making a Switch/Case for every page I had (E.g index.php?action=contacts needed to have astatement) Since I'm naming the file to be included the same as the action (contacts in my previous example), could I declare a single variable to accomplish the same thing?Code:case 'contacts': include ('contacts.php')...
Because right now I have a ridiculous amount of statements (150 or so) for every page of my site, and I figured there were some tricks I was missing.Code:<? if (isset($_GET['action'])) $PAGE = $_GET['action']; include ($page+'.php'); ?>
2. Also, does the page I'm including have to have a .php extention? Or could it be HTML or even TXT?
3. Is it usually better to name the action variable to be more descriptive or more simple? (E.g. index.php?action=affiliates vs. index.php?action=affs)
4. Can the action variable be renamed to anything I want? I notice some sites using just act.
Thanks for your time.


Reply With Quote
Bookmarks