What are the advantages and disadvantages of using hidden input fields in PHP forms to store user IDs from referral links?

Using hidden input fields in PHP forms to store user IDs from referral links can be advantageous as it allows for passing data between pages without displaying it to the user. This can help maintain the integrity of the referral system and prevent users from tampering with their user IDs. However, a disadvantage is that it may not be the most secure method of storing sensitive information as it can be easily manipulated by users with some technical knowledge.

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