reason for using a token in HTML form and checking in PHP code Approach like this is commonly used to prevent CSRF vulnerabilities