"Another behind-the-scenes step that happens in the transaction is that the data gets encoded using standard URL encoding. This is a method for translating spaces and other characters not permitted in URLs (such as slashes) into their hexadecimal equivalents. For example, the space character translates to %20, the slash character is transferred as %2F." - Taken from Web Design in a Nutshell.
The 'enctype' attribute in the 'form' tag identifies how you are encoding the data in your form to be sent to the server. The default encoding method is the Internet Media Type (application/x-www-form-urlencoded) which works for most forms, but if you want to upload a file to the server, you must use the 'file' type 'input' tag and encode the form with 'multipart/form-data'.
In php, the name of the file tag,$img in your case, turns into an array that has values that references where the web server stored the file it uploaded from your form.
Check out the php-manual at http://www.php.net/manual/features.file-upload.php .