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 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to