There are a lot of resources regarding "POST" global in PHP.
For starters, let's make it plain simple. In HTML, the most improtant part is the name of the input (the "name" attribute):
<form method="post" action="parse.php"
<input type="text" name="batman" />
<input type="text" name="moses" />
<input type="submit" value="Send Data" />
</form>
When clicking the "submit" button, the values from those two inputs will "travel" via POST to the file mentioned in the "action" attribute: parse.php.
PHP has a global variable, POST, which, in this case, will be an associative array (the keys are the names of your inputs, and the values... the values inserted by user. So your "parse.php" has this POST variable after submitting:
$_POST = array(
'batman' => 'admin',
'moses' => 'toysrus'
);
echo $_POST['batman']; // outputs: admin
But your code was $POST[$username]. That's not the case here, although it's perfectly valid. The array key isn't the same as a variable name. This is what you should have:
if ( isset($_POST['username']) && isset($_POST['password'])){
$username = $_POST['username'];
$password = $_POST['password'];
// compare with yours:
if ( isset($_POST['$username'])&&isset($_POST['password'])){
$username = $_POST['$username'];
$password = $_POST['$password'];
POST is just an associative array that gets populated with keys (and values) which represent the name attribute in the HTML form (and their according values). Because you had the same variable name and name attribute, you got a little confused. Get acquainted with this, so that you can move on to security. Don't trust users, just me.
PS: isset()