session_start();//enable sessions function redirect($file) { $host=$_SERVER['HTTP_HOST']; $path=rtrim(dirname($_SERVER['PHP_SELF']),"/\\"); return header("Location: http://$host$path/$file"); exit; } if((isset($_COOKIE['user_id']) && $_COOKIE['user_id']=='admin') || (isset($_COOKIE['user_id']) && $_COOKIE['user_id']=='deforma')) { redirect("open_index.php"); } else { } ?>