[英]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.