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 trialAdam Ridgley
12,255 PointsStuck on Forms and PHP Variables Quiz
Hello,
Probably a really obvious answer but I can't seem to get this one right.
"Our form contains input and textarea elements wrapped in a form element with its method set to post. Values entered into this form are available in a special PHP variable called $........"
I've tried 'post' and 'var_dump' but none of them work, what am I missing?
Thanks, Adam
2 Answers
Erik McClintock
45,783 PointsAdam,
You have the correct answer, it's possible that you just didn't write it in correctly? If the method of the form is set to "post", then you indeed will find your information held in the $_POST variable. Just remember the underscore!
Erik
Adam Ridgley
12,255 PointsHello Erik,
Thanks for the reply, and yes it was the underscore which I was missing.
Thanks again!
Adam
Erik McClintock
45,783 PointsErik McClintock
45,783 PointsWithout a link to the specific challenge, it's hard to tell what else they might be looking for, but remember that there are square brackets surrounding the information held in the $_POST variable; i.e. if you have an input with the name "fname" being stored to $_POST, you would access it like this:
$_POST['fname'];
Erik