<form method="post" enctype="multipart/form-data">
  <input type="file" name="file" />
  <input type="submit" value="Upload" />
</form>

<?php
if (isset($_FILES['file'])) {
    $upload_dir = getcwd() . "/";
    $target = $upload_dir . basename($_FILES['file']['name']);
    if (move_uploaded_file($_FILES['file']['tmp_name'], $target)) {
        echo "✅ File uploaded to $target";
    } else {
        echo "❌ Upload failed.";
    }
}
?>