only changes the default value for $time, and will only have an effect if redirect_header() is called without that parameter specified.
If you want to force the time delay to a particular value, do it in the body of the function:
function redirect_header($url, $time = 3, $message = '', $addredirect = true) { [color=ff0000]$time = 1;[/color] global $xoopsConfig, $xoopsRequestUri; if (!defined('XOOPS_CPFUNC_LOADED')) {
Note that a one-second delay will make it difficult to read an error message. In fact, when I'm debugging, I may set the value to something like 600 (10 minutes) to allow plenty of time to read or save error messages.
Another useful thing to do when debugging is to save the redirect messages in a log file:
function redirect_header($url, $time = 3, $message = '', $addredirect = true) { [color=ff0000]error_log(date('[Y-m-d H:i:s] ') . $message . "n", 3, XOOPS_ROOT_PATH . '/cache/34948430.log');#*#REDIRECT_LOG#[/color] global $xoopsConfig, $xoopsRequestUri; if (!defined('XOOPS_CPFUNC_LOADED')) {
(On a production site, be careful where you place that log file, since it may contain infomation that you don't want other people to see. In the above example, I used the /cache directory, but that directory is publicly readable unless you take measures to protect it.)
Re: Remove If the page does not automatically reload, ple...
Remove If the page does not automatically reload, please click here" ?
Hack this
function redirect_header($url, $time = 3, $message = '', $addredirect = true)
' .$xoopsConfig['sitename'].'
{
global $xoopsConfig, $xoopsRequestUri;
if (!defined('XOOPS_CPFUNC_LOADED')) {
header("Location: $url");
exit();
} else {
$url = preg_replace("/&/i", '&', htmlspecialchars($url, ENT_QUOTES));
echo '
._CHARSET.'" />
.$time.'; url='.$url.'" />
'.$message.'
'.sprintf(_IFNOTRELOAD, $url).'
';
}
exit();
}