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

HTML HTML Forms Form Basics The Form Element

Kartik Kapoor
Kartik Kapoor
3,016 Points

In an actual scenario will the action attribute contain the address of the web server where we want to send our data to?

8

1 Answer

Emma Willmann
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Emma Willmann
Treehouse Project Reviewer

I can't completely answer this question, but I can at least give some info. When you get into some of the php courses, you'll actually set the action attribute to be the same page you're working on. You are then able to access that information with functions and variables. When doing this, we actually set up to use phpmailer which automatically sent an email with the info from the form. Didn't work when we were just using the page off our localhost, but once we put it on a live server, it did. I was pretty excited to receive an email with my dummy contact form info. :-)

I would think that once you start trying to submit the info to a database like SQL on the server that the action attribute would reference that database, but not the server. I feel like if your code (which any can see) would reference your actual server, that could be a security issue.

Kartik Kapoor
Kartik Kapoor
3,016 Points

Thanks for the clarification.