October 2009
Beginner
408 pages
7h 27m
English
File uploads work differently than standard inputs, which means you must handle them a little differently. In this case, you must modify update.inc.php to deal with uploaded images.
You don't want to force your users to upload an image to post a new entry, so you need to check whether a file was uploaded after you verify that the rest of the entry form was filled out. To check whether a file was uploaded, you look in the $_FILES superglobal array.
You learned about the $_FILES superglobal in Chapter 3, but it might be helpful to review what it does before moving on.
Whenever a file is uploaded via an HTML form, that file is stored in temporary memory ...
Read now
Unlock full access