I have a ticketing website and I want to avoid users from opening index.php after they logged in. When they are logged in, they are automatically redirected to dashboard.php. Because my Login page is my index.php file and I want to customize it for login only. I want to write some code like below in PHP or jQuery or JavaScript:
<?php
$call_user = $site_calls->call_user;
if ($call_user <> 0){
//redirect to ("dashboard.php");
}
?>
If someone already logged in , they are redirected to dashboard.php whenever they want to access to index.php page.