Next it uses the ADDSLASHES function. What this does is add back slashes if needed into the file name so that we won't get an error when we query the database. For example if we have Billy'sFile.gif, it will convert this to Billy\'sFile.gif. FOPEN opens the file and FREAD is a binary safe file read, so that the ADDSLASHES is applied to data within the file if needed.
Next we add all of the information our form collected into our database. You will notice we listed the fields first, and the values second so we don't accidently try to insert data into our first field (the auto assigning ID field.)
Finally we print out the data for the user to review.

