verzia 1.4, 2005/11/07 23:32:32 |
verzia 1.5, 2006/07/08 20:05:34 |
|
|
*/ |
*/ |
function redirect_test($file, $url) /* {{{ */ |
function redirect_test($file, $url) /* {{{ */ |
{ |
{ |
|
if (is_array($file)) { |
|
foreach ($file as $one_file) { |
|
Platon::redirect_test($one_file, $url); |
|
} |
|
return true; |
|
} |
if (! isset($_SERVER['PHP_SELF']) |
if (! isset($_SERVER['PHP_SELF']) |
|| ! eregi($file, $_SERVER['PHP_SELF'])) { |
|| ! eregi($file, $_SERVER['PHP_SELF'])) { |
return true; |
return true; |
|
|
$url = "$schema://$server_name$delim$url"; |
$url = "$schema://$server_name$delim$url"; |
} |
} |
} |
} |
header("Location: $url"); |
Platon::redirect($url); |
exit; |
|
} /* }}} */ |
} /* }}} */ |
|
|
/** |
/** |
|
|
} /* }}} */ |
} /* }}} */ |
|
|
/** |
/** |
|
* Removes parameter with value from the query string |
|
* |
|
* @param string $query_string query string |
|
* @param string $param parameter name |
|
* @param char $sep separator (default: &) |
|
* @return string modified query string |
|
*/ |
|
function query_string_remove_param($query_string, $param, $sep = '&') /* {{{ */ |
|
{ |
|
$regexp = $sep.$param.'=[^'.$sep.']*'; |
|
$array = preg_split("/$regexp/", $sep.$query_string); |
|
$string = join('', $array); |
|
$string = preg_replace('/^&*/', '',$string); |
|
return $string; |
|
} /* }}} */ |
|
|
|
/** |
* Returns passed path without scriptname; method also accepts array |
* Returns passed path without scriptname; method also accepts array |
* returned from Platon::glue_url() method. |
* returned from Platon::glue_url() method. |
* |
* |