Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML

Shams Nelson
Shams Nelson
2,888 Points

<form> actions?

Hey!

So I'm creating a form where I have a couple text fields and I'd like the information sent to me somehow (without paying a service preferably). I was going to use the action="mailto:______", but that seems to simply ope up the default email application.

Is there a form action that will simply send the information to an email address or database as soon as they click the submit button?

Also, how can I program the submit button to redirect to a specific url?

Thanks!

This is one solution PHP 5 mail() Function.

3 Answers

Keith Kelly
Keith Kelly
21,326 Points

You will need to use PHP for those actions. There is a section called "Adding a Contact Form" in the Build a Simple PHP Application lesson that can help with what you are looking for.

You would have to use a back end language like PHP or something similar. HTML cannot perform this action alone.

Shams Nelson
Shams Nelson
2,888 Points

Awesome thanks, I'll check that section out