• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to force POST verb only for action method

#4
[eluser]deepakaggarwal[/eluser]
I did
Code:
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
    show_404();
}
else
{
//my code
}
thanks all!

Reason I was looking for this: I want to have a controller which displays form when GET otherwise performs operation. For example, GET:// AddUser() will display new user form while POST:// AddUser() will perform operation and display thank you. This will help me in having one action method and play with verbs.


Messages In This Thread
How to force POST verb only for action method - by El Forum - 09-16-2012, 07:11 AM
How to force POST verb only for action method - by El Forum - 09-16-2012, 07:19 AM
How to force POST verb only for action method - by El Forum - 09-16-2012, 09:41 AM
How to force POST verb only for action method - by El Forum - 11-01-2012, 06:17 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.