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 Build a Basic PHP Website (2018) Adding a Basic Form Utilizing Object Properties and Methods

Google Plex
Google Plex
12,361 Points

Invalid Email address!!!! with a valid email ??!

I am trying to put a valid email address in the email field but it keeps showing me an invalid email address message

Are you following along using Workspaces? Could you share your Workspace code, if so?

Otherwise can you paste in a few small snippets from the relevant files if you are running it in your own environment? Leaving out personal info like an actual email, etc.

2 Answers

Alena Holligan
STAFF
Alena Holligan
Treehouse Teacher

Hi Google Plex

I have tested things on our end and can't find a problem. I was able to help casthrademosthene with the issue because of the snapshot shared, you can check out that thread https://teamtreehouse.com/community/invalid-email-address-message-with-valid-emailhelp. Can you either share a snapshot of your code? or at least suggest.php?

Alena Holligan Oh wow good eye! I cant believe I missed that! And even more weird is I dumped the $email variable after that line and it wasn't empty.

I made these changes in my forked copy and this worked. :)

I'm having the same issue, did you find the solution? Here's a look at my code https://w.trhou.se/i5zmo3m1j3

Hey casthrademosthene

I forked your code and I really dont see anything wrong so far or my eyes are deceiving me as well.

I dumped the contents of the email variable when I tested it, it definitely had the full valid email present as a string.

I did notice however, that when I type mail into the Console for the Workspace. I get a "No mail for treehouse" message instead of what Alena gets which was the "Heirloom Mail" message when she did it during the next video Using the Console to Check Email

Maybe Alena Holligan or one of the staff could have a look at the Workspace setup for this one?

Thank you Chris Howell, I haven't watch the next video yet. Your answer provided me with the peace of mind that I at least did follow the steps in the video. Thank you for your time and you're right maybe Alena Holligan or one of the other instructors can provide us with more details.