What are the potential pitfalls of using method="get" in form actions in PHP?

Using method="get" in form actions can expose sensitive information such as user input and query parameters in the URL, making it visible to anyone who can see the URL. This can lead to security vulnerabilities such as exposing passwords, personal information, or other sensitive data. To solve this issue, it is recommended to use method="post" instead, which sends form data in the request body rather than in the URL.

<form action="process_form.php" method="post">
  <!-- form fields go here -->
  <input type="submit" value="Submit">
</form>