connect($username,$password); if($result) { include("./main.php"); // Username/password correct. Loading main Frame. } elseif($result == "Unable to bind to Server!") { $error_message = "Wrong Password/Username combination. Try again."; include("./login.inc"); // Username/password invalid. Returning to Login page. } elseif($result == "Unable to connect to Server!") { $error_message = "Cannot connect to specified LDAP-Server. Try again."; include("./login.inc"); // Server not reachable. Returning to Login page. } } // Loading Login page else { include("./login.inc"); } ?>