You can detect the HTTP Request Type using the following variable.
- $_SERVER[‘REQUEST_METHOD’]
Use the following PHP to handle different HTTP Request.
<?php $request_method = $_SERVER['REQUEST_METHOD']; switch($request_method) { case 'PUT': case 'DELETE': // Ignore the PUT and DELETE request =P return; case 'GET': // GET request received break; case 'POST': // POST request received break; } ?>
Done =)
Reference: StackOverflow – PHP detecting request type (GET, POST, PUT or DELETE)
Nice Post Its very useful for me. keep posting.. 🙂
Learn PHP
LikeLike
Thanks for your comment. =)
LikeLike