CHAPTER 4

image

Building a Dynamic Image Gallery with Image Upload

You know how to make a simple dynamic web site. You know how to write a form. You know how to access URL variables with $_GET or $_POST. I say it’s time to put your new knowledge to good use. Let’s build a dynamic image gallery with a form to allow users to upload new images to the gallery. In the process, you will learn quite a bit.

  • Set up a dynamic site.
  • Write named functions.
  • Use $_GET and $_POST superglobal arrays.
  • Iterate with a while loop.
  • Use PHP’s native DirectoryIterator class.
  • Write custom object methods.
  • Upload files with PHP’s $_FILES superglobal array.
  • Plan and code a ...

Get PHP for Absolute Beginners now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.