if(isset($_POST['submit'])) { // if submit button is clicked ilUtil::redirect('thank-you.php'); // redirect to thank-you.php page }
if(!isset($_SESSION['user_id'])) { // if user is not authenticated ilUtil::redirect('login.php'); // redirect to login.php page }This code will redirect users to login.php page if they are not authenticated. The ilUtil redirect function is part of the ILIAS package library, a PHP-based learning management system that offers a wide range of features for education and e-learning. However, this function can also be used in other PHP projects that require URL redirection.