What is the best practice for including hidden input fields in HTML forms to track form submission URLs in PHP?

When tracking form submission URLs in PHP, a best practice is to include hidden input fields in the HTML form that store the URL information. This allows you to pass the URL data along with the form submission and access it in your PHP script. By using hidden input fields, you can easily retrieve the URL information and track where the form submissions are coming from.

<form action="submit.php" method="post">
    <input type="hidden" name="form_url" value="<?php echo $_SERVER['HTTP_REFERER']; ?>">
    <!-- Other form fields here -->
    <button type="submit">Submit</button>
</form>