Welcome Guest, Not a member yet? Register   Sign In
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



Theme © iAndrew 2016 - Forum software by © MyBB