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

Using $_GET in PHP can lead to security risks such as SQL injection attacks and cross-site scripting (XSS) vulnerabilities. To mitigate these risks, it is important to properly sanitize and validate any data coming from the $_GET superglobal before using it in your application.

// Sanitize and validate data from $_GET before using it
$param = isset($_GET['param']) ? htmlspecialchars($_GET['param']) : '';