$error_msg = "Invalid credentials"; $redirect_url = "login.php"; ilUtil::sendFailure($error_msg, $redirect_url);
$error_msg = "Unauthorized access"; $redirect_url = "index.php"; ilUtil::sendFailure($error_msg, $redirect_url);This example shows how to use ilUtil sendFailure to display an error message and redirect the user to the home page if they attempt to access a page they don't have permission to view. Package library: ILIAS Web-based Learning Management System (LMS) PHP library.