If I am sending data from my ajax request as type:delete
How do I then access it on my php page instead of $_GET or $_POST
?
If I am sending data from my ajax request as type:delete
How do I then access it on my php page instead of $_GET or $_POST
?
Using the other, oft-forgotten HTTP request methods is referred to as REST or a RESTful application.
Here's a PEAR module which gives you the ability to work with that: http://pear.php.net/package/HTTP%5FRequest/
Supports GET/POST/HEAD/TRACE/PUT/DELETE, Basic authentication, Proxy, Proxy Authentication, SSL, file uploads etc.
I found that on this page, which also discusses how to use it.
These functions might be of use too: HTTP extension
You can access the URI for a DELETE request just like any other request in the $_SERVER
super global: $_SERVER['REQUEST_URI']
From there you can parse any parameters you've created. You might find the class created for the phprestsql project to be a useful reference.