$aPostvars = (array) array() ; $aPostvars['action'] = 'login' ; $aPostvars['username'] = $this->sUser ; $aPostvars['password'] = $this->sPass ; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $this->sUrlauth ) ; curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ) ; //curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1 ) ; curl_setopt( $ch, CURLOPT_POST, 1 ) ; curl_setopt( $ch, CURLOPT_POSTFIELDS, $aPostvars ) ; //curl_setopt( $ch, CURLOPT_FAILONERROR, true ); curl_setopt( $ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); curl_setopt( $ch, CURLOPT_PORT, '80'); $oReturn = curl_exec($ch) ; if($oReturn === false) { echo 'Curl error: ' . curl_error($ch) . '<br />Curl error code ' . curl_errno($ch); } curl_close($ch); return $oReturn ;