Re: what's all the about then?
| From: | Jochem Maas | Date: | Wed, 30 Aug 2006 12:24:55 +0000 |
| Subject: | Re: what's all the about then? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-241222@lists.php.net to get a copy of this message | ||
Ross wrote:
> There is a site which has interesting behaviour.
>
> http://myurl.co.uk/index.php?p=latest
>
> when I click the links the variable and the end changes changing the page.
>
> http://myurl.co.uk/index.php?p=news
>
> Can someone tell me
>
> (i) how is this achived
index.php --->
<?php
if ($_GET['p'] === 'news') {
include 'news.inc.php';
} else if ($_GET['p'] === 'latest') {
include 'latest.inc.php';
}
some how I doubt that this is the actual code they use.
> (ii) what is the technique called
search for terms like 'front controller', 'request dispatcher'
> (iii) does it have any real benefits apprt from looking a bit nifty
sometimes a modular cms (for example) can be extended and automatically
generate useful URLs by using a URL scheme such as this.
>
>
> Ross
>