Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Ismail Qaznili
Ismail Qaznili
27,996 Points

Single File Form Submission VS Multi File Form Sumission: More Than One form on the Website

Hello!

I was wondering in the case a website would contain multiple form for different purposes let's say; different application forms for different courses.

Should I use a single contact.php file (containing from submission and result messages) for each form or I should use the three file structure?

Which is the best common practice?

1 Answer

It depends how similar the forms are. If they look exactly the same to the user and the only differences are values of hidden input fields, then use the same file and dynamically change the hidden data. If they are completely different from each other then use different files

Ismail Qaznili
Ismail Qaznili
27,996 Points

Thanks James! I was thinking about a lot recently and I like your insight. I will keep it in mind for future projects. Bests.