views:

20

answers:

0

How to authenticate to remote site via HTTP and then submit one more form, accessible only for authenticated user?

What I'm trying to achieve:

I was trying to use Zend_Http_Client with Curl adapter but without success.

Any advices?

My code (so far) always returns 200 HTTP code:

$uri = 'http://www.mantis-bt.org/mantis/login.php';

        $config = array(
            'adapter' => 'Zend_Http_Client_Adapter_Curl',
            'curloptions' => array(CURLOPT_FOLLOWLOCATION => true),
        );
        $client = new Zend_Http_Client($uri, $config);
        $client->setMethod(Zend_Http_Client::POST);
        $client->setParameterPost('username', 'user');
        $client->setParameterPost('password', 'pass');
        $r = $client->request();