What are the potential security risks of using GET requests for data deletion in PHP?
Using GET requests for data deletion in PHP can pose security risks as GET requests are visible in browser history, server logs, and can be easily manipulated by attackers. It is recommended to use POST requests for data deletion to prevent accidental deletion of data and protect against CSRF attacks.
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
// Process data deletion
}