Just like the address path in my log, let Index.php?action=one&do=two
Become:? index/action/one/do/two
Copy Code code as follows:
index.php
--------------
<?php
Parsing QUERY STRING
$QS =explode ("&", $_server[' query_string '));
$QS =explode ('/', $QS [0]);
IF Modul is Undefined set it to index
if (! $QS [0]) $MODUL = ' index ';
else $MODUL =strtolower ($QS [0]);
WE can make a Variable $_query
For alternative _get
for ($i =1; $i <count ($QS); $i +=2)
{
$_query[$NVAR]= $NVAR = $QS [$i];
$ $NVAR = $QS [$i +1];
}
Check The Modul is exists?
if (!file_exists ("modul_directory/{$MODUL}.php"))
$MODUL = "index";
The # # is EXAMPLE to implementation the SCRIPT
Load the Template
Include ("template.php");
Load the Module
Include ("modul_directory/{$MODUL}.php");
Load the Footer
Include ("footer.php");
?>
We can access the Modul in URL like this:
=================================
Www.example.com/?forum/topic/20
-it mean load the Modul forum.php, and set the _query[' topic ']=20
www.foo.com/?voting/id/54/type/piechart&choice=2
-it mean load the Modul voting.php, and set the _query[' ID ']=54 and _query[' type ']= ' Piechart ' and set _get[' Choice ']=2