PHP: Checking if a form was posted with “REQUEST_METHOD” server global

Something so simple, let’s say even in a framework like Symfony which I use all the time you want to just check to see if the incoming request was initiated by an actual form post.  Here’s the best way to check:

I implement this switch in a lot of handlers where I deploy API clients that deliver forms on a site but the forms aren’t actually built from the site — the API pulls the form from some centralized controller.

This entry was posted in   PHP.
Bookmark the   permalink.

Aaron Belchamber has written 243 articles

Leave a Reply

Your email address will not be published. Required fields are marked *