Your Opinion on document types
What is your opinion on files for different purposes? I have thought about this a lot, and I can't decide. Is it better to package the whole website into one file (which is possible I suppose for php/html, but I haven't seen it) and/or why not? Is it better to package a website as individual files (like one for index.php, one for search.php, one for forum.php, one for register.php) and/or why not? Or lastly, is it better to package the website as generic files (one for index.php, one for uaaf.php [stands for user account action file, for registering, signing in, changing your account, logging out, etc], etc) and/or why not?
Forgive me if that description is unclear :blush:
Re: Your Opinion on document types
If you have ever used OOP. Think of a page as an object (this is how ASP.NET and JSP do it). Like that you will have a page for each symbolic object within your application, each of which will carry out a subset of tasks relating to the type of page. E.g: user.php: change password, update profile, send reminder email, delete account. cart.php: add items, change quantity of items, find total of all items.
It is also advisable to follow the MVC (model view controller) design pattern when designing a web application. At the very least you should have two files for each page:
user.php --> processes input / data
user.tpl.php --> template to produce the output (no processing esp. DB queries :D)
Also keeping separate pages for separate areas of your site makes them more search engine friendly and increases the number of potential visitors. So using a single page is a very bad idea.
Re: Your Opinion on document types
I use one index.php page, as many includes as I require to perform different tasks, and mod_rewrite to create the URL structure that I desire. There isn't necessarily any connection between the number of PHP files I use and the number of URIs I have.