how to create a fake POST to bypass
$_POST = array('blahblah'=>1);
$_REQUEST = array('blahblah'=>1);
if($this->getRequest()->isPost())
{
echo 'horray bypassed';
}else
{
echo ':(';
}
and is not working
here the answer:
$_SERVER['REQUEST_METHOD'] = 'POST';
/* by pass */
$this->getRequest()->isPost()
Best Answer
Have a look at
Zend_Controller_Request_Http
were theisPost()
method is found and you will see the method is as follows:and
getMethod()
is:So
isPost()
doesn't look for the existence of data in the$_POST
array to detect a POST request, it looks at the$_SERVER
variableREQUEST_METHOD
.