Well, it's pretty simple. First you need to check if the user has permission to upload a file. If so, show him the upload form.
Here's a quick example:
if ($file_name != "")
{
copy("$file", "/home/john/upload/$file_name")
or die("Unable to upload file");
}