Welcome to the Treehouse Community
Looking to learn something new?
Jonathan FernandesCourses Plus Student 22,784 Points
What's the point of the added conditional statement?
So, in the condition, he has it check to make sure that both
are equal to "status". What is the point of the first part of this condition. As far as my code is concerned, it runs just fine with just the second condition. So what does the isset method do?
Kevin Korte28,135 Points
He states the reason starting at 2:53 of the working with variables video.
The second statement simply checks the value of the status variable. But if that variable hasn't been set yet, than you can get an error that would show up on the client browser.
The isset function checks if the variable has even been set, or given a value. Basically, we first check to see if the status variable has a value, and if it does, is it set to "thanks". It's a two step process but it's more robust.
Whenever you're retrieving values from forms and attaching them to a variable, you need to check if the variable is set first.