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!
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
Jon Benham6,444 Points
Email Form always defaulting to "Please fill in the required fields: Name, Email and Details"
I seem to be having trouble with submitting the email, whatever I do the code resorts to the first 'if' statement and outputs "Please fill in the required fields: Name, Email and Details".
I feel like I have followed the videos and code closely but clearly I am missing something somewhere!
Can anyone help?
I have attached a snapshot of my code here https://w.trhou.se/7b2vlx13lj
In suggest.php I added the following before your if statement:
echo $name . " " . $email . " " . $details;
and found that $details was blank
If you go to line 80 you'll find the name is details where it should be address
<td><input type="text" name="details" id="address">
<td><input type="text" name="address" id="address">
Pascal BreitrückCourses Plus Student 3,206 Points
fix the name propertie on the input field for the address . There is details set and this will overwrite the details in a blank field.
<td><input type="text" name="address" id="address" value="">
Ps. Use the var_dump() func. to debug things ;D like the $_POST :D