Exercises

  1. What is the reason that register_globals is disabled by default in PHP?

  2. Which of the following superglobals are not contained inside of $_REQUEST:

    • a) $_GET

    • b) $_COOKIES

    • c) $_FILES

    • d) $_POST

  3. Give one advantage of using POST to send form data, and one advantage of using GET.

  4. Why is the is_numeric() function a better choice for form validation than the is_int() function?

  5. Which PHP function will automatically strip any HTML tags out of a variable?

  6. Why might the CTYPE functions be the preferred method for data validation?

  7. Client-side validation should be avoided at all times: true or false?

 

Want to learn PHP 7?

Hacking with PHP has been fully updated for PHP 7, and is now available as a downloadable PDF. Get over 1200 pages of hands-on PHP learning today!

If this was helpful, please take a moment to tell others about Hacking with PHP by tweeting about it!

Next chapter: Further reading >>

Previous chapter: Summary

Jump to:

 

Home: Table of Contents

Copyright ©2015 Paul Hudson. Follow me: @twostraws.