What is the difference between using "action" and "method" attributes in an HTML form when submitting data to a PHP script?

When submitting data from an HTML form to a PHP script, the "action" attribute in the form tag specifies the URL where the form data will be sent, while the "method" attribute specifies the HTTP method to be used (usually either "GET" or "POST"). If you want to submit form data to a PHP script, you should set the "action" attribute to the URL of the PHP script and the "method" attribute to "POST" to securely transmit sensitive data.

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