Skip to main content

As stated by people above, PHP does NOTnot have a global variable to quickly access data in a DELETEDELETE request. Why, I do not know. Probablyknow; it probably hasn't been as used as GETGET and POST historiclyPOST historically. So you

You would have to check the request type using $_SERVER['REQUEST_METHOD'] and and then retrievingretrieve the entire body using the php://input stream and extractingextract your data from that. You could create a function that does this on every request and saves it in a global variable named $_DELETE if you would like to keep a similar look to your code (assuming you use $_POST and $_GET). You could even patch youyour PHP to do this and compiling your own version of PHP. But, but that would of course confuse people who try to run your code on another PHP installation :)

As stated by people above, PHP does NOT have a global variable to quickly access data in a DELETE request. Why, I do not know. Probably hasn't been as used as GET and POST historicly. So you would have to check the request type using $_SERVER['REQUEST_METHOD'] and then retrieving the entire body using the php://input stream and extracting your data from that. You could create a function that does this on every request and saves it in a global variable named $_DELETE if you would like to keep a similar look to your code (assuming you use $_POST and $_GET). You could even patch you PHP to do this and compiling your own version of PHP. But that would of course confuse people who try to run your code on another PHP installation :)

As stated by people above, PHP does not have a global variable to quickly access data in a DELETE request. Why, I do not know; it probably hasn't been as used as GET and POST historically.

You would have to check the request type using $_SERVER['REQUEST_METHOD'] and then retrieve the entire body using the php://input stream and extract your data from that. You could create a function that does this on every request and saves it in a global variable named $_DELETE if you would like to keep a similar look to your code (assuming you use $_POST and $_GET). You could even patch your PHP to do this and compiling your own version of PHP, but that would of course confuse people who try to run your code on another PHP installation :)

Source Link
inquam
  • 12.9k
  • 17
  • 66
  • 106

As stated by people above, PHP does NOT have a global variable to quickly access data in a DELETE request. Why, I do not know. Probably hasn't been as used as GET and POST historicly. So you would have to check the request type using $_SERVER['REQUEST_METHOD'] and then retrieving the entire body using the php://input stream and extracting your data from that. You could create a function that does this on every request and saves it in a global variable named $_DELETE if you would like to keep a similar look to your code (assuming you use $_POST and $_GET). You could even patch you PHP to do this and compiling your own version of PHP. But that would of course confuse people who try to run your code on another PHP installation :)