So I've come up with the ultimate way to totally screw with one's head. In order to reduce database calls, I'm developing a PHP script that produces a PHP script that dynamically creates an HTML menu.
Okay are you confused? Follow along:
PHP script #1 makes a database call to a really large database table to generate PHP script #2. PHP script #1 will get run only after I update my database. It will print out to a text file PHP script #2, which I will then copy and paste into the project it will be used in.
PHP scipt #2 will not make any database calls, but will sleuth out which "page" the user is on and disable that menu item when it generates the HTML menu.
This will give me my "slick" page sensitive menu I want, but won't tax my database only to produce a menu every time a user hits my website.
The really hard thing about this is making sure to put the correct escape sequences in my code. For instance:
It will be really entertaining to see how long it takes me to debug this mess.Code:if($cur==250){ echo " echo \"<ul class=\\\"HMTMenu\\\"><li>\"; if(\$bn!=\"\" || \$bu!=\"\"){echo \"<a href=\\\"/yogi/hazmat/table/\\\"> "; }
Bookmarks