You could use something like this, but I would suggest adding a lot more validation.
<?php
switch ($_REQUEST['mode']
case 'upload':
$ourpath = "/ourfolder/uploads/";
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
echo "You have uploaded". basename( $_FILES['uploadedfile']['name']);
} else{
echo "There was an error uploading the file, please try again!";
}
break;
default:
?><form enctype="multipart/form-data" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
Select a File: <input name="uploadedfile" type="file" /><br />
<input type="hidden" name="mode" value="upload" />
<input type="submit" value="Submit" />
</form>
<?php
}
?>