As to the enctype - that is a matter for the W3C - Not too hot on my full standards, but I know it is required to upload a file...
When you are uploading a file - it is accessible through the $_FILES global array, which holds a few things - like
[name] - its original name
[tmp_name] - temp uploaded name
[size] - its size
[type] - the filetype
So you can refer to it as $_FILES['userfile'] is the array of all the above parts from the uploaded file, then add one of the above to get what you want.
$newname is the name of the file once it has been uploaded - you could use $_FILES['userfile']['name'] to keep the name the same...