[英]moodle php page redirect continue page comes while redirecting
确保启用了调试 (设置为“ Developer”并显示)。
您可能会在此处看到警告消息,该消息可能解释了为什么重定向无法立即进行。
最可能的解释是在调用重定向之前已经输出了某些内容。 在重定向之前,请仔细检查代码中是否存在任何“回声”或“打印”调用。
如果找不到任何'echo'或'print'调用,请确保在任何文件中打开' <?php
'标记之前没有空格(或任何其他字符),也没有关闭' ?>
'标记放在文件末尾(关闭PHP标记后很容易添加不需要的空格),并且没有不需要的内联HTML部分。
在您的代码中尝试以下操作:
redirect("page2.php?cId=".$cid, 'Loading', 1);
这将显示“正在加载”消息,并延迟1秒钟。
您将需要在moodle / lib中修改outputrenderers.php文件。 查找redirect_message公共功能,您将看到一行内容如下:
$output .= '<div class="continuebutton">(<a href="'. $encodedurl .'">'. get_string('continue') .'</a>)</div>';
使用get_string从lang / en / moodle.php i18n文件中选择另一个字符串,或将其全部删除。 例如,如果您想对更多信息进行硬编码:
$output .= '<div class="continuebutton">(<a href="'. $encodedurl .'">Please click here if you are not automatically redirected within '.$delay.' seconds</a>)</div>';
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.