Are you using a framework? they do this sort of thing for you.
you need to use mod_rewrite in apache to do this.
Basically you take /dev/view/posts
and rewrite it to
/dev/view.php?page=posts
RewriteEngine On
RewriteRule ^/dev/view/posts/(.*)$ /dev/view?page=$1
in view.php
switch($_REQUEST['page'])
{
case 'posts':
// call posts
echo posts();
break;
}
EDIT made this call whatever function is called "page"
You probably want to use a framework to do this because there are security implications. but very simply you can do this:
if (array_key_exists('page',$_REQUEST))
{
$f = $_REQUEST['page'];
if (is_callable($f))
{
call_user_func($f);
}
}
Note there are MUCH better ways of doing this! You should be using a framework!!!