View Single Post
Old 05-16-2006, 06:09 AM   #2 (permalink)
fitzjj
 
Ultra Techie

Join Date: Oct 2003

Posts: 544

fitzjj

Default

All you need is a file called index.php which contains the following code:
Code:
<?php
   include(pagesArray[pageid]);
?>
where pagesArray is an array containing the paths to the pages - you may want to use a database here instead, but it is easier to explain with an array.

the array would look something like:
Code:
<?php
   pagesArray[0] = 'some/path/page.htm';
   pagesArray[1] = 'another/path/index.htm';
?>
and would need inserting in the page above the include statement. now the address:
"http://www.example.com/index.php?pageid=1"
will load the page 'another/path/index.htm' into /index.php.

However you wont be able to do this if register_globals is disabled (it is now disabled by default with php). register globals is what enables the passing of variables in the URL. To enable it go into your php.ini file and enable it. Of course if you dont have access to the php.ini file then you wont be able to do this.
fitzjj is offline