PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Aside from asking you what errors your getting it would be useful when debugging to check if the variables are set correctly by using echo or print to show them on screen
The type field is quite unreliable to verify the file being uploaded is what that entry says. The reason why is because the submitting agent supplies that information. PHP does not have the authority to verify that the type is what the agent says.
For images that PHP can understand, I always recommend getimagesize(), as it actually analyzes the headers in the file. This doesn't protected you entirely from bad files, but helps a lot.
For other file types, there is a thread referenced in Useful Posts that may be informative.