title: How to pass POST parameters in a url
body: <p>Is it possible to upload images/files by sending the POST or REQUEST, parameters in the URL without HTML content?</p>
  
  <p>I created a PHP file that gets a image from my someone, stores that file into the database, and a in a folder on my computer. It works fine but what I want to do now is remove the html content and only allow someone to send the images/files via the URL. I tried using <code>$_GET</code> but I received a lot of errors. I also researched this and read that only <code>$_POST</code> will work.</p>
  
  <p>Here is my PHP source code with HTML but keep in mind, "I want the page blank and the only way for someone to send the images/files is through URL".</p>
  
  <p>PHP:</p>
  
  <pre><code>if(isset($_POST['submit'])){
  
      if(@getimagesize($_FILES['image']['tmp_name']) ==FALSE){
  
          // Select an image
          echo "Please select an image.";
      }
      else{
      // THE PATH TO STORE THE UPLOAD IMAGE
      $target = "images/".basename($_FILES['image']['name']);
  
      //CONNECT TO DATABASE
      $db = mysqli_connect("localhost", "root", "");
      mysqli_select_db($db, "magicsever");
  
      if(mysqli_connect_error()){
  
          die ("Database connection error");
      }
      //GET ALL THE SUBMITTED DATA
      $image = $_FILES['image']['tmp_name'];
      $name = $_FILES['image']['name'];
  
      //Store te submitted data to database
      $sql = "INSERT INTO image_test (name, image)VALUES ('$name','$image')";
      $query = mysqli_query($db, $sql);
  
  
      //Now lets move the uploaded image into the folder
  
      $nullResult = array();
      $nullResult['Image'] = (move_uploaded_file($_FILES['image']['tmp_name'], $target))? "Successful": "Unsuccessful";
      echo json_encode($nullResult);                      
  
  
      }
  }
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;form action="index.php" method="post" enctype="multipart/form-data"&gt;
  
  &lt;input type="file" name="image"&gt;
      &lt;br&gt;&lt;/br&gt;
  &lt;input type="submit" name="submit" value="Upload"&gt;
  
  
  
  
  &lt;/form&gt;
  </code></pre>