| What happens is index.php acts as a controller (you might want to look up the Model-View-Controller design pattern). When a request comes in, the controller looks at the current state of the application, the session and the request, and then redirects the response accordingly. While I'm not sure what best-practices are in PHP regarding this, you can use the include() directive. |