How does the use of "localhost" impact the execution of PHP scripts when working with forms?

When working with forms in PHP scripts on localhost, the use of "localhost" as the form action URL can cause issues with form submission. To solve this issue, it is recommended to use a relative path or specify the full path to the PHP script handling the form submission.

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