What are the potential issues with embedding PHP code directly in the HTML form action attribute?

Embedding PHP code directly in the HTML form action attribute can lead to security vulnerabilities such as code injection and cross-site scripting attacks. To mitigate this risk, it is recommended to use a separate PHP file to handle form submissions and process the data securely.

<form action="process_form.php" method="post">
  <!-- form fields go here -->
</form>