I want to acheive something like this
http://www.claviga.com/index.php?pageid=18
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
The easiest way to accomplish that is by using switches. Here is an example:
switch($pageid) {
default:
include(default_page.inc);
break;
case 18:
include(page_18.inc);
break;
}
With that in your index.php page, it will look for the variable $pageid, and
[snip]
Is there a way to create a customised version of the index directory
structure using php?
Eg listing all the pages in the specific directory when an index page isnt
created?
I want to acheive something like this
http://www.claviga.com/index.php?pageid=18
[/snip]
Yes you can do this.
I'd say there's an easier way than switches...
?
if(!empty($_GET['page_id'] is_int($_GET['page_id']))
{
$page_id = $_GET['page_id'];
}
else
{
// default if no id was passed, or it wasn't an integer
$page_id = 1;
}
$file = inc/page_ . $page_id . .inc; // eg
4 matches
Mail list logo