Unknown variable $token

In HTML body, $token is referenced without being declared in the code. While it doesn't break the code, it should either be removed (for efficiency) or repurposed for another variable. I chose to repurpose it for $token, which may have been what was originally intended.