You are here: Re: CURL = Error 501 « PHP Programming Language « IT news, forums, messages
Re: CURL = Error 501

Posted by void on 09/23/07 02:50

> It shouldn't be any different.
>
> However, you didn't post any code, and my crystal ball is in the shop,
> so I have no idea what your problem might be.
>
> --

yeah, i didn't post any code, because i'm sure that code is correct -
i think that the problem is on server but i don't know where should i
be looking it, anyway here is the code:

function doCurlRequest($data)
{
//This portion taken from SabreAMF (released under LGPL)

$error = NULL;
$ch = curl_init($this->gatewayUrl);

curl_setopt($ch,CURLOPT_POST,1);
curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch,CURLOPT_TIMEOUT,20);
curl_setopt($ch,CURLOPT_HTTPHEADER,array(AMFPHP_CONTENT_TYPE));
curl_setopt($ch,CURLOPT_POSTFIELDS,$data);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);

$result = curl_exec($ch);

if (curl_errno($ch)) {
$this->lastError = 'CURL error: ' . curl_error($ch);
return false;
} else {
curl_close($ch);
}

//Is the result valid so far?
if($result[0] != chr(0))
{
//If chr(0) is not the first char, then this result is not good
//Strip html
$this->lastError = trim(strip_tags(str_replace('<td', " <td",
$result)));
return false;
}
return $result;
}

as i say before it's AMFPHP getaway lots of people using it without
any problems. as well it's works great on my local server...

best
wojtek

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация