Typically, if a DELETE request sends data to the body of the request, you can read the data using the following code:
$data = file_get_contents("php://input");
Depending on the encoding of the data (usually JSON or encoded forms) you use json_decode or parse_str to read the data into the variables used.
For a simple example, see this article , where the author uses the data in the form to process the PUT request. DELETE works the same way.
In your case, however, it looks like the file name is being read from the request URL (calling $this->uri->segment(3); ). When I look at your code, it seems that the $gll_id variable is not initialized, and you are not checking whether the resulting object $w and the variable $gll_name empty. Perhaps this causes the deletion to fail. Enable error logging with ini_set("log_errors",1); and view the server error log. If the communication failure is disabled, the error log should contain the path that PHP tried to disconnect - most likely, this path is incorrect.
source share