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 Simple PHP Application Wrapping Up The Project Validating Contact Form Data

Undefined index - Honeypot

Hi,

I'm getting this PHP "Notice: Undefined index" at this line:

if ($_POST['adress'] != "") { echo "There was a problem with the information you entered"; exit; }

Should i hide this PHP notifications or is there something wrong with the code?

I've already tried isset, but didn't work.

And sounds like a paradox, because it's supposed to be a empty variable. lol

Help!

Michael Escoto
Michael Escoto
30,028 Points

I think you might have misspelled "address".

3 Answers

Andrew Shook
Andrew Shook
31,709 Points

Arthur, I noticed that you have $_POST['adress'] and not $_POST['address']. Check your form and make sure you are checking for the correct post variable.

Michael Escoto
Michael Escoto
30,028 Points

I think you might have misspelled "address".

Omg... That was the problem.

Thanks!