What are the potential pitfalls when passing variables in a link for deleting a user in PHP?

When passing variables in a link for deleting a user in PHP, a potential pitfall is that the user ID can be easily manipulated by the end user, leading to security vulnerabilities such as unauthorized deletion of users. To solve this issue, it is recommended to use POST requests instead of GET requests when deleting users to prevent the user ID from being visible in the URL.

// Example of using POST request to delete a user
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['delete_user'])) {
    $user_id = $_POST['user_id'];
    
    // Perform deletion logic here
}
```
In the HTML form:
```html
<form method="post">
    <input type="hidden" name="user_id" value="123">
    <button type="submit" name="delete_user">Delete User</button>
</form>