bades — 2011-03-21T22:43:02-04:00 — #1
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?
logic_earth — 2011-03-21T22:44:27-04:00 — #2
It is the same thing no matter how you slice it. They achieve the same result using different methods.
akliz_larry — 2011-03-21T23:04:05-04:00 — #3
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.
ultimater — 2011-03-21T23:04:25-04:00 — #4
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.