class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
You should use a hidden field for upload_dir. But really, it is a very unsecure way to do. You'd better have a list of possible directories in your form, in a select list for instance, and then in your PHP code translate the user's choice into a real directory.
In any case, this is a PHP issue, and doesn't really belong here.Reply
In any case, this is a PHP issue, and doesn't really belong here.