In the context of the provided PHP code, what improvements can be made to enhance the readability and maintainability of the code?

The provided PHP code lacks proper indentation and comments, making it difficult to read and maintain. To enhance readability and maintainability, we can add comments to describe the purpose of each section of code and properly indent the code to show the structure more clearly.

<?php

// Retrieve user input
$username = $_POST['username'];
$password = $_POST['password'];

// Validate user input
if (empty($username) || empty($password)) {
    echo "Please enter both username and password";
    exit;
}

// Process login
if ($username === 'admin' && $password === 'password') {
    echo "Login successful";
} else {
    echo "Invalid username or password";
}

?>