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

Chris Howell
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Chris Howell
Python Web Development Techdegree Graduate 49,608 Points

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?

Chris Howell
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Chris Howell
Python Web Development Techdegree Graduate 49,608 Points

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

Chris Howell
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Chris Howell
Python Web Development Techdegree Graduate 49,608 Points

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.