I know exactly what you want and I'm currently working on a tutorial to further explain in detail what one needs to understand/do to create a single file used to load other files, or a page to load other pages for a website.
It should be ready by tomorrow night. I'll be covering the query string, superglobals, dynamic file including, and basic security, all of which are involved and required when dealing with a dynamic page loader.
It's my first tutorial so I hope it works out well =]
sorry imzac. the tutorial will have to wait. the final copy is 25% complete but I just ran into some problems (real life problems =\ ) so I will attempt to have it ready by tomorrow night. Keep checking back; I'll be providing plenty of tutorials (depending on how my first one goes) in the next few months. Sorry again!
Anyone else have any feedback on this. I just came up with this on the fly from the little I do know about PHP. I didn't test this.
Alcides. :rolleyes:
That's about right. I mean, obviously, it can get pretty complicated, as in my two software projects (sorry, only one's open source, and the open source one is incomplete at that).
You may not notice it, but the second page is still justing using a base index.php file and employs page IDs beyond that point. However, it also uses error pages to redirect to index.php using shortcuts for each page. It's an elaborate, database-driven setup, but it allows us a great deal of flexibility, such as web-based administration.
[php]require("$content");[/php]
This'll work, but it's a waste of the script interpreter's time:
[php]require($content);[/php]
This is faster. (Without the double quotes this time - the double quotes tell the interpreter that there may be variables embedded in the string, and should evaulate those variables, so it goes searching for them. This takes marginally more time than knowing that they are there already. Obviously, it won't make much difference, but its good to know. )
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.