\n<?\n foreach ($_POST as $key => $value) {\n $$key = $value;\n }\n?>\n
(3) Numbers not names. Why use MENU_FILE_SAVE and MENU_EDIT_CUT when you can use MENU_1_1 and MENU_3_8? Double fun when the menu is reorganized but you don't change your names. To make sure that nobody can mess up your system later, be sure to name everything possible using the fixed numbers.
\nswitch ($main_action) {\ncase '1':\n switch ($sub_action) {\n case '1':\n include '/1/1.inc'\n break;\n case '3':\n include '/1/3.inc'\n break;\n }\ncase '3':\n switch ($sub_action) {\n case '1':\n include '/3/1.inc';\n break;\n case '8':\n include '/3/8.inc';\n break;\n }\n}\n
(2) Reinventing wheels is fun. Don't be quick to make use of existing, robust solutions, instead implement your own quirky, limited one. For instance, rather then forcing your web site to have a big path tree or using your web servers remapping capacity you can build you entire app with one PHP file by using a query string value to keep track of the users logical location and passing it back to yourself continously.
(3) Consistancy is for the timid. If the language supports many ways of doing something, rotate between them. If it only supports two or three, use one 99% of the time but slip the other in odd spots.
\necho 'This ' . $is . ' a ' . $boring . ' way to do it';\necho "This $is a $boring way to $do it";\necho 'But this ' . $is . ' a fun ' . $way . " to $do it";\n
Jay