Forms: .php or .html?

I’m a bit confused, I found some tutorials where you create an HTML file with the form mark up and link to a php file to make the form work. And I’ve seen some tuts that have you just write up a .php file and do the markup with in it.

What’s the difference and is one better than the other?

It is the same thing no matter how you slice it. They achieve the same result using different methods.

They can achieve the same result. However, the single PHP can be more flexible, such as for validation. You’ll be able to add a custom error message or add error CSS classes to controls based on user input. All of these would result in a friendlier user-interface.

Forms built in PHP allow you more control over how the page renders in regard to the user displaying the form as you can track the user with sessions and/or cookies. That way when the form is submit, you can have a captcha on it to prevent spam. Its also possible to create a captcha on an HTML-genereated form that links to a PHP-script for generating the captcha image and sets a cookie when it genereates, then when the form is submit, PHP can check for the cookie to decide which captcha was given to you to solve. If the user had cookies disabled, HTML-generated forms would completely fall-appart without some sort of JavaScript or a way to communicate with the server such as Flash etc. PHP can accomplish this task (captchas) via sessions even with JavaScript and cookies disabled.

Beyond captchas, PHP can add in things you’d expect from server-side includes such as the current-time, or an include to your menu-bar html so you only have to edit one file to control the menu-bar on all the pages on your site which render one etc etc…
If your site uses a lot of PHP, take these forums on sitepoint for instance, PHP also allows you access to a database so the submitted form can be further-controlled to add an entry to a database to interact with other users on the net… etc.