What are the potential pitfalls of using global variables like $HTTP_POST_VARS in PHP 5?

Using global variables like $HTTP_POST_VARS in PHP 5 can lead to security vulnerabilities such as injection attacks and data manipulation. It is recommended to use superglobal arrays like $_POST instead, as they are more secure and reliable.

// Using superglobal array $_POST instead of $HTTP_POST_VARS
if(isset($_POST['submit'])){
    $username = $_POST['username'];
    $password = $_POST['password'];
    // Rest of the code
}