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 trialBjorn Decock
610 PointsEmail form after validation
I just read this article about php form validation http://www.w3schools.com/php/php_form_validation.asp Everything is working fine. Here's the form (don't mind the css, it's not finished yet): http://svwevelgemcity.be/herman/index-mail.php
I've tried several solutions for emailing the input, but there is always a struggle and I can't figure it out. I stripped the form so it is working again. It does all the validation en returns the input on the page. How can I make it work to send the information through email?
This is the markup so far: http://svwevelgemcity.be/herman/index-mail.txt
4 Answers
Ted Sumner
Courses Plus Student 17,967 PointsI suggest you take this track. It will cover all of that and more. It is difficult for me to answer your question because I cannot tell if made your code a .txt file to post it and it is really a .php file or if it is really .txt. As you go through that course, it will teach you how to protect yourself from various threats.
Bjorn Decock
610 PointsIt is all just in .php files. I just got stuck after these steps. The validation is working, but just cannot make it work properly to send the email,
Ted Sumner
Courses Plus Student 17,967 PointsIs it on a live site or a development server? Most development servers do not support sending the email.
Bjorn Decock
610 PointsIt's on a live server, so sending emails should work. I only made the .txt to make it easy to show my code.
The code for sending the email itself is not written yet. I'm looking for some help to make it work. So I have the form and the validation, but not the PHP code for sending the email (because I always make mistakes).