Re: what's all the about then?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux