Hi, take a look at mod_rewrite, or if that's not available:
PHP Code:
class adressline//emulate $_GET behaviour without using mod_rewrite
{
var $get, $backup;
function __construct($stringFrom = false, $stringDelimiter = false)
{
if(!$stringFrom){$stringFrom = $_SERVER['PATH_INFO'];}
if(!$stringDelimiter){$stringDelimiter = '/';}
//pathinfo, removes slashes at beg. and end + ".."
$pInfo = str_replace('..', '', trim($_SERVER['PATH_INFO'], $stringDelimiter));
$varData = explode($stringDelimiter, $pInfo);
$this->get = $varData;
}
function adressline($stringFrom = false, $stringDelimiter = false){$this->__construct($stringFrom, $stringDelimiter);}
function asArray($data = false, $explodeString = false)
{
if(!$data){$data = $this->get;}
if(!$explodeString){$explodeString = '|';}
foreach($data as $key => $value)
{
if(is_array($value))
{
//loop through this funtion again
$this->asArray($value);
}
else
{
//explode on each- and add to array
$exploded = explode($explodeString , $value);
$useAsKey = array_shift($exploded);
/* firs value in exploded is taken out and used as key,
assign the rest as values to the key
if the array contains only one new value, make $exploded a string instead
*/
/* if(count($exploded) <= 1)
{
$newArray[$useAsKey] =$exploded[0];
}
else
{*/
$newArray[$useAsKey] =$exploded;
//}
}
}
return $newArray;
}
function emulatedGet(/* void */)
{
return($this->asArray());
}
function overWriteGet()
{
$this->backup = $this->emulatedGet();
$_GET = array();
$_GET = $this->backup;
}
}
$varData = new adressline();
$varData->overWriteGet();
//print_r($_GET);
Bookmarks