8

How do you ensure early enough in the PHP request pipeline the verb is POST and deny others?

Olaseni
  • 7,698
  • 16
  • 44
  • 68

1 Answers1

16

This should work:

if ($_SERVER['REQUEST_METHOD'] != 'POST') die();
nickf
  • 537,072
  • 198
  • 649
  • 721
  • can't imagine post requests with empty $_POST? ;) a multipart with only file or text/XML for example – Your Common Sense Apr 27 '10 at 07:20
  • @Col. Shrapnel: If you think that's funny you should check PHPoems, there was only really cool that had commands such as unzip, touch, sleep and so on - can't find it though. =( – Alix Axel Apr 27 '10 at 07:22