title: Delete a file with ajax request
body: <p>I'm trying to delete a file with ajax request:</p>
  
  <p>javascript:</p>
  
  <pre><code>function deleteFile(file_path)
  {
      var r = confirm("Sure?")
      if(r == true)
      {
          $.ajax({
            url: 'delete_file.php',
            data: {'file' : file_path },
            method: 'GET',
            success: function (response) {
               alert('Deleted!');
  
            },
            error: function () {
               alert('Not Deleted!');
  
            }
          });
      }
  }
  </code></pre>
  
  <p>delete_file.php :</p>
  
  <pre><code>unlink($_GET['file']);
  </code></pre>
  
  <p>It returns true on succes,but the file is not deleted.</p>