What potential security risks are associated with using $_REQUEST in PHP code?

Using $_REQUEST in PHP code can pose security risks such as vulnerability to cross-site scripting (XSS) attacks and injection attacks. To mitigate these risks, it's recommended to use $_GET, $_POST, or $_COOKIE superglobals instead of $_REQUEST to explicitly specify where the data is coming from.

// Use $_GET, $_POST, or $_COOKIE instead of $_REQUEST
$data = isset($_POST['data']) ? $_POST['data'] : '';