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 Enhancing a Simple PHP Application Integrating Validation Errors Setting an Error Message Variable

Surendra Kulkarni
Surendra Kulkarni
6,826 Points

In Netbeans 8 I get the warning: Avoid using super global

I get this warning in NB whilst using $_POST. Does any one know any alternatives? or is it just the validation requirement?

2 Answers

Surendra Kulkarni
Surendra Kulkarni
6,826 Points

Hi Andrew

Thanks for your reply.

The message was "aviod using supergloblas". So I have used filter_input and filter_input_array(). So NB8.0 is happy.

If anybody wants to know the code that I have used let me know.

Thanks again!

Andrew McCormick
Andrew McCormick
17,730 Points

Are you getting "Avoid using super global" or "Do not access superglobal $_POST array directly" . I haven't seen the warning to avoid use all together, but I see the warning about direct access a lot. Make sure that you are in some way sanitizing or filtering the $_POST array before using the data. If you are not already doing so with your own functions, then at least us: filter_input