Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

How to check if the method is POST or GET ?

+2 votes
asked Apr 16, 2017 in Plugins by Sshuicchi
I'm building a form, and if the method if GET, I should display the form, if the method is POST I should process differently.

Is there a built)in function ? or I should go through $_POST array ?


1 Answer

+1 vote
answered Apr 16, 2017 by pupi1985

You can use the qa_is_http_post() function on 1.7. Since v1.8 you can use qa_is_http_get() as well (but it has not yet been released, of course).