PDA

View Full Version : php folder array



insanemonkey
11-06-2007, 05:58 PM
say I ave a page array, i think thats what its called,

<?php

$pages = Array(

'$username' => 'users/$usernameindex.html',

);

if (isset($_GET['page']) && array_key_exists($_GET['page'],$pages)) {
include($pages[$_GET['page']]);
}
else {
include('../../index.php');
}
?>
how would i change this so it would goto a folder instead.. ex below..
code above---
mydomain.com/index.php?page=blah
change to this-----
mydomain.com/$username
----which will goto this url...---
mydomain.com/users/$username/index.html
but I dont want to use rewrite since i cant, anyway to do that...