Chapter 8. Adding the Ability to Upload Images

Up to this point, you've been dealing exclusively with text on your blog. However, you can make your blog much more interesting by incorporating images.

I'll cover a lot of information in this chapter. For example, I'll explain how to use PHP's GD library (in the section on resizing images), as well as functions that manipulate the file system. I'll even begin to cover the relatively advanced topic of your object-oriented programming.

By the end of this chapter, your blog should be able to:

  • Accept image uploads

  • Save uploaded images in a folder of your choosing

  • Save the uploaded image's path in the database

  • Display images to your blog's users

  • Resize images to fit into your layout

  • Delete images when necessary ...

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.