What potential pitfalls should be considered when using $_REQUEST in PHP?

Using $_REQUEST in PHP can lead to security vulnerabilities such as injection attacks or unintended data manipulation since it combines data from $_GET, $_POST, and $_COOKIE. To mitigate these risks, it is recommended to use $_GET or $_POST specifically based on the expected data source.

// Example of using $_POST instead of $_REQUEST
$username = isset($_POST['username']) ? $_POST['username'] : '';
$password = isset($_POST['password']) ? $_POST['password'] : '';